Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
According to the source code for su (line 138 onwards from su.c in shadow-4.0.3):
Code:
/*
* su - switch user id
*
* su changes the user's ids to the values for the specified user. if
* no new user name is specified, "root" is used by default.
*
* The only valid option is a "-" character, which is interpreted as
* requiring a new login session to be simulated.
*
* Any additional arguments are passed to the user's shell. In
* particular, the argument "-c" will cause the next argument to be
* interpreted as a command by the common shell programs.
*/
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789
Rep:
Quote:
Originally Posted by gilead
According to the source code for su
That isn't su original source code, su was written by Dennis Ritchie and Ken Thompson in 1971.
This command original meaning and purpose was "super user" (from AT&T internal Unix source code, version 1 to 6) but evolved to "substitute user" in version 7, when the su command was changed to allow becoming any account, just not root. Version 7 su manual page states
Code:
su - substitute user id temporarily
"switch user" is almost synonymous, but doesn't appear in any Unix documents, so it can't be the correct answer IMHO.
I would have actually answered Something Usable but apparently it wasn't among the choices, so I had to take the other option (if everybody answered the correct answer, this wouldn't be fun).
I love the way unix systems take the Donald Duck abbreviations into use, I just hoped there were more of them
As stated the original Unix command, which was the first to use this, was used to become the super user (root). In adopting this, Linux it appears to have applied a more generic application of the command to switch user.
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789
Rep:
The three answers are all valid:
- super-user was what the original unix command stands for, but never make it outside Bell Labs.
- substitute user is Unix version 7 definition, kept by all its descendants and sometimes but not always used as Synopsis in su manual pages.
- switch user is an alternative and technically valid definition found in Gnu su.c source code, which implement the same functionality as the version 7 Unix su. Gnu documentation is still using "substitute user" http://www.gnu.org/software/coreutil...#su-invocation.
I've always known it as Super User or switch user. Mainly cause $su by itself defaults to the (SUPER!!!)root but of course specifying $su <user> you can switch to other users . All the other names for it just confuses things.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.