Creating symbolic link


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Creating symbolic link
# 1  
Old 09-27-2006
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  
Old 09-27-2006
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  
Old 09-27-2006
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  
Old 09-27-2006
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  
Old 09-27-2006
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  
Old 09-27-2006
I'm trying to figure out the principle behind what you're asking. What problem are you trying to solve, exactly?
# 7  
Old 09-27-2006
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Symbolic link

Hi, trying to understand more about symblic link, when I compiled a program called "match" in one folder ~/downloadsoftware/I want this program to be accessible like a system command by putting a symbolic link in /usr/bin/ Not by setting the $PATH method in .bashrc at this time. What I did is:... (4 Replies)
Discussion started by: yifangt
4 Replies

2. UNIX for Dummies Questions & Answers

[Solved] Symbolic link not allowed or link target not accessible

Hi everybody, I read about treads realted to this issue but they did not resovle issue given below. Please help me resolve issue given below I have html file under /srv/www/htdocs/actual_folder ls actual_folder/ test.html and following link works... (0 Replies)
Discussion started by: newbielgn
0 Replies

3. Shell Programming and Scripting

ls on a symbolic link

Hi all, Can anyone please confirm if the command below is the only way that I can get what the symbolic link is set to? mnlxd110(oracle)/db/posd2/dba$: ls -l | grep "^l" lrwxrwxrwx 1 oracle dba 28 Aug 9 2011 bdump -> diag/rdbms/posp1/posp1/trace mnlxd110(oracle)/db/posd2/dba$:... (7 Replies)
Discussion started by: newbie_01
7 Replies

4. UNIX for Dummies Questions & Answers

Odd while Creating Symbolic Link

Hi, # mkdir usr3 # ls -l /h/uxossolbld10/0/teamcity/agent total 8 drwxrwxr-x 14 test1 rdl 512 Nov 30 02:54 conf drwxrwxr-x 3 test1 rdl 512 Jun 24 14:21 scripts drwxrwxr-x 10 test1 rdl 512 Jun 3 2011 teamcity drwxrwxr-x 4 test1 ... (1 Reply)
Discussion started by: Divakar
1 Replies

5. Shell Programming and Scripting

Symbolic Link Help

Hello All, This may be a silly question to some but I am really stuck. Is there a way to reverse the following; sudo rm /bin/sh sudo ln -s /bin/bash /bin/sh It was part of a driver compile/installation procedure by Digi for Ubuntu stating that dash isn't supported and a symbolic link... (2 Replies)
Discussion started by: LAVco
2 Replies

6. Shell Programming and Scripting

symbolic link

Hi, i am trying to create sym links on sles 11 , but it seems i am doing something wrong. oracle@tests:/u01/app/oracle/oradata/ACIS> pwd /u01/app/oracle/oradata/ACIS oracle@tests:/u01/app/oracle/oradata/ACIS> ln -s /db/ACIS/dbase/dbf/ /u01/app/oracle/oradata/ACIS/... (2 Replies)
Discussion started by: tonijel
2 Replies

7. Shell Programming and Scripting

tar the symbolic link

Hi Experts!! Can anyone help me out to know how can we tar the symbolic links. I would need to find the symbolic links present in the directory and then tar them out. I can find the links by find . -type l, but i need to know how to tar the symboilc link. Any help would be much appreciated.. ... (1 Reply)
Discussion started by: ganga.dharan
1 Replies

8. UNIX for Dummies Questions & Answers

need some info about symbolic link and hard link

hello folks how y'all doin well i have some questions about symbolic link and hard link hope some one answer me i open terminal and join as root and i wrote ln -s blah blah then i wrote ls i see red file called blah blah but didn't understand what is this can some one explain and... (2 Replies)
Discussion started by: detective linux
2 Replies

9. UNIX for Dummies Questions & Answers

Symbolic Link Confusion

I have just tried to make my first shortcut aka symbolic link. I entered this command: ln -s /one/two/three/four/help/admin admindirectory to make a link called 'admindirectory' that would take me to: /one/two/three/four/help/admin It seems to have created a directory called... (5 Replies)
Discussion started by: Sepia
5 Replies

10. UNIX for Dummies Questions & Answers

symbolic Link

question abt symbolic link ... i'm doing the following ... ln -s x.sh ./scripts/y.sh and cat ./scripts/y.sh it is giving following error cat: cannot open y.sh Any reason u an think of ? But it is working fine when i goto scripts directory and cretae the symbolic link. ... (1 Reply)
Discussion started by: bhargav
1 Replies
Login or Register to Ask a Question