It appears that you're running an Ad-Blocker. This site is monetized by Advertising and by User Donations; we ask that if you find this site helpful that you whitelist us in your Ad-Blocker, or make a Donation to help aid in operating costs.

su

su (short for substitute user) is a Unix command used to run the shell of another user without logging out. It is commonly used to change to root user permissions for administrative work without logging off and back on; it is also used to switch to other users in the same way. Desktop environments such as KDE and GNOME have programs that pop up a password query box before allowing a user to run commands that would typically require such access.

When invoked without a target user, the root user is assumed (identical to su root).

Uses:

When run from a command line, as is typical, su asks for the target user's password, and, if accepted, grants the user access to that account and all of the files associated with it.

eddie@localhost:~$ su
Password:
root@localhost:/home/eddie# exit
logout
eddie@localhost:~$

One can switch to another user who is not the superuser; e.g. su james.

eddie@localhost:~$ su james
Password:
eddie@localhost:/home/eddie$ exit
logout
eddie@localhost:~$

It should generally be used with a hyphen by administrators (su -, which is identical to su - root), which can be used to start a login shell. This way users can assume the user environment of the target user:

eddie@localhost:~$ su - james
Password:
james@localhost:~$
Posted on May 31st, 2014

Comments

( Posted)

Related Products

▼ Sponsored Links ▼
▲ Sponsored Links ▲
Donate Today