Sponsored Content
Full Discussion: Creating symbolic link
Top Forums Shell Programming and Scripting Creating symbolic link Post 302090837 by hegemaro on Wednesday 27th of September 2006 03:46:10 PM
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.
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
SU(1)								   User Commands							     SU(1)

NAME
su - change user ID or become superuser SYNOPSIS
su [options] [username] DESCRIPTION
The su command is used to become another user during a login session. Invoked without a username, su defaults to becoming the superuser. The optional argument - may be used to provide an environment similar to what the user would expect had the user logged in directly. Additional arguments may be provided after the username, in which case they are supplied to the user's login shell. In particular, an argument of -c will cause the next argument to be treated as a command by most command interpreters. The command will be executed by the shell specified in /etc/passwd for the target user. You can use the -- argument to separate su options from the arguments supplied to the shell. The user will be prompted for a password, if appropriate. Invalid passwords will produce an error message. All attempts, both valid and invalid, are logged to detect abuse of the system. The current environment is passed to the new shell. The value of $PATH is reset to /bin:/usr/bin for normal users, or /sbin:/bin:/usr/sbin:/usr/bin for the superuser. This may be changed with the ENV_PATH and ENV_SUPATH definitions in /etc/login.defs. A subsystem login is indicated by the presence of a "*" as the first character of the login shell. The given home directory will be used as the root of a new file system which the user is actually logged into. OPTIONS
The options which apply to the su command are: -c, --command COMMAND Specify a command that will be invoked by the shell using its -c. The executed command will have no controlling terminal. This option cannot be used to execute interractive programs which need a controlling TTY. -, -l, --login Provide an environment similar to what the user would expect had the user logged in directly. When - is used, it must be specified as the last su option. The other forms (-l and --login) do not have this restriction. -s, --shell SHELL The shell that will be invoked. The invoked shell is chosen from (highest priority first): The shell specified with --shell. If --preserve-environment is used, the shell specified by the $SHELL environment variable. The shell indicated in the /etc/passwd entry for the target user. /bin/sh if a shell could not be found by any above method. If the target user has a restricted shell (i.e. the shell field of this user's entry in /etc/passwd is not listed in /etc/shells), then the --shell option or the $SHELL environment variable won't be taken into account, unless su is called by root. -m, -p, --preserve-environment Preserve the current environment, except for: $PATH reset according to the /etc/login.defs options ENV_PATH or ENV_SUPATH (see below); $IFS reset to "<space><tab><newline>", if it was set. If the target user has a restricted shell, this option has no effect (unless su is called by root). Note that the default behavior for the environment is the following: The $HOME, $SHELL, $USER, $LOGNAME, $PATH, and $IFS environment variables are reset. If --login is not used, the environment is copied, except for the variables above. If --login is used, the $TERM, $COLORTERM, $DISPLAY, and $XAUTHORITY environment variables are copied if they were set. Other environments might be set by PAM modules. CAVEATS
This version of su has many compilation options, only some of which may be in use at any particular site. CONFIGURATION
The following configuration variables in /etc/login.defs change the behavior of this tool: CONSOLE_GROUPS (string) List of groups to add to the user's supplementary groups set when logging in on the console (as determined by the CONSOLE setting). Default is none. Use with caution - it is possible for users to gain permanent access to these groups, even when not logged in on the console. DEFAULT_HOME (boolean) Indicate if login is allowed if we can't cd to the home directory. Default is no. If set to yes, the user will login in the root (/) directory if it is not possible to cd to her home directory. ENV_PATH (string) If set, it will be used to define the PATH environment variable when a regular user login. The value is a colon separated list of paths (for example /bin:/usr/bin) and can be preceded by PATH=. The default value is PATH=/bin:/usr/bin. ENV_SUPATH (string) If set, it will be used to define the PATH environment variable when the superuser login. The value is a colon separated list of paths (for example /sbin:/bin:/usr/sbin:/usr/bin) and can be preceded by PATH=. The default value is PATH=/sbin:/bin:/usr/sbin:/usr/bin. SULOG_FILE (string) If defined, all su activity is logged to this file. SU_NAME (string) If defined, the command name to display when running "su -". For example, if this is defined as "su" then a "ps" will display the command is "-su". If not defined, then "ps" would display the name of the shell actually being run, e.g. something like "-sh". SYSLOG_SU_ENAB (boolean) Enable "syslog" logging of su activity - in addition to sulog file logging. FILES
/etc/passwd User account information. /etc/shadow Secure user account information. /etc/login.defs Shadow password suite configuration. EXIT VALUES
On success, su returns the exit value of the command it executed. If this command was terminated by a signal, su returns the number of this signal plus 128. If su has to kill the command (because it was asked to terminate, and the command did not terminate in time), su returns 255. Some exit values from su are independent from the executed command: 0 success (--help only) 1 System or authentication failure 126 The requested command was not found 127 The requested command could not be executed SEE ALSO
login(1), login.defs(5), sg(1), sh(1). shadow-utils 4.1.5.1 05/25/2012 SU(1)
All times are GMT -4. The time now is 03:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy