The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
tar the symbolic link ganga.dharan Shell Programming and Scripting 1 05-23-2008 07:11 AM
need some info about symbolic link and hard link detective linux UNIX for Dummies Questions & Answers 2 01-08-2008 07:36 AM
Symbolic Link Confusion Sepia UNIX for Dummies Questions & Answers 5 05-07-2007 05:40 PM
symbolic Link bhargav UNIX for Dummies Questions & Answers 1 10-15-2004 09:41 AM
get symbolic link file andrec UNIX for Dummies Questions & Answers 11 11-13-2001 03:41 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-27-2006
charbel charbel is offline
Registered User
  
 

Join Date: Feb 2006
Posts: 41
Creating symbolic link

Any idea how to create a symbolic link...for example i want to create a symbolink link for a specific user in his profile to use the df command...?

Thanks in advance
  #2 (permalink)  
Old 09-27-2006
hegemaro hegemaro is offline
Registered User
  
 

Join Date: Feb 2006
Location: Schenectady, NY
Posts: 134
A few more details, please. After reading your posting, I am left with the impression that you're more interested in aliases (defining pseudonyms for commands) and not in creating alternate paths for files.
  #3 (permalink)  
Old 09-27-2006
charbel charbel is offline
Registered User
  
 

Join Date: Feb 2006
Posts: 41
What i want to do is to create a directory having the commands that a specific user can execute....the only way i know is to create a directory have symbolic link of the commands that i want that user to access......
  #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.
  #5 (permalink)  
Old 09-27-2006
charbel charbel is offline
Registered User
  
 

Join Date: Feb 2006
Posts: 41
how about if i want to add a new user and give him just the same privlege as the root?....i know i am asking too much but i want to get the principle behind all this....
  #6 (permalink)  
Old 09-27-2006
Corona688 Corona688 is offline
Registered User
  
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 1,909
I'm trying to figure out the principle behind what you're asking. What problem are you trying to solve, exactly?
  #7 (permalink)  
Old 09-27-2006
hegemaro hegemaro is offline
Registered User
  
 

Join Date: Feb 2006
Location: Schenectady, NY
Posts: 134
I just responded to a similar question. The simple answer is giving an account a UID of 0 is the same as making another root (DON'T DO THIS UNLESS YOU HAVE REALLY GOOD REASON). For example, at my office, we have a "cert" account with full root access but the password is sealed in an envelope with our security department incase of multiple bus accidents for the admins.

There is sudo -- http://www.gratisoft.us/sudo/ -- which can be used to configure root access on certain commands for a given list of users.

However, I suspect the answer is much simpler. Generally, UNIX commands are broken into two major categories:

1 ) user (stored in /bin or /usr/bin)
2 ) administrative (stored in /sbin or /usr/sbin), and

User commands are for the entire user population and include such basics as ls, mkdir, cp, and vi. Whereas administrative commands are meant to be used by the system administrator for such things as mounting file systems, configuring devices, adding users, and such.

There are really very few circumstances (I'm a bit of a purist) where any account other than that of an administrator requires root access to execute a command. One common example is running backups from, say, an operator's account.

This could be a very long thread if we got into a full-blown discussion. In short, to give a non-root user access to a given command:

1 ) Set the PATH environment variable as needed,
2 ) alias the command
3 ) Use sudo ONLY if root access is absolutely required.
Sponsored Links
Closed Thread

Bookmarks

Tags
unix commands

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 06:18 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0