The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 09-27-2006
hegemaro hegemaro is offline
Registered User
  
 

Join Date: Feb 2006
Location: Schenectady, NY
Posts: 134
I see several possibilities here so let me take them one at a time.

1 ) Limit access to non-OS commands for a given user

You could create a directory anywhere on the system (perhaps in a "bin" subdirectory from the user's home) where commands -- compiled or script -- could be stored. Those commands could then be owned by that user and be executable only by that ID. Simply add the directory to the user's PATH environment variable.

2 ) Create a alias for a given command

This is useful when you have a particularly complicated command perhaps with many options. By using alias(1) in the user's profile, you can simplify any command. One that was standard twenty years ago when I first did this is college was:

alias la="/bin/ls -la"

3 ) I'm making this way too hard and you want the user to execute some admin commands such as df(1M)

Just add /usr/sbin to the user's PATH.