Substitute User

su stands for `substitute user’ and not `super user.’ (Thanks to slacker for pointing out the mistake).

su - preserves the current environment variables so that they are available for the user who has been switched to.

su -l provides a login shell.

su [USER] if USER is not specified, root is assumed by default

su -c allows to run a command as the specified user


2 Responses to “Substitute User”

  1. December 24, 2007 at 11:27 am

    Err, not to be a jerk but actually it stands for Substitute User (http://www.linfo.org/su.html) (http://www.freebsd.org/cgi/man.cgi?query=su&apropos=0&sektion=0&manpath=Unix+Seventh+Edition&format=html)

    I might also add that for most people (and for all Ubuntu derived systems) sudo -i is better, if sudo is installed.

    Furthermore, sudo should always be preferred over su -c. This is because sudo is more powerful and easier to control (thus making it an absolute must on multiuser systems from the security viewpoint)

  2. December 25, 2007 at 6:23 am

    Thank you slacker. I have edited the post.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: