Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Su (Unix)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Usage == When run from the command line, su asks for the target user's password, and if authenticated, grants the operator access to that account and the files and directories that account is permitted to access. <syntaxhighlight lang="console"> john@localhost:~$ su jane Password: jane@localhost:/home/john$ exit logout john@localhost:~$ </syntaxhighlight> When used with a [[hyphen]] ({{mono|su -}}) it can be used to start a login shell. In this mode users can assume the user environment of the target user. <syntaxhighlight lang="console"> john@localhost:~$ su - jane Password: jane@localhost:~$ </syntaxhighlight> The command [[sudo]] is related, and executes a command as another user but observes a set of constraints about which users can execute which commands as which other users (generally in a configuration file named {{mono|/etc/sudoers}}, best editable by the command {{mono|[[visudo]]}}). Unlike {{mono|su}}, {{mono|sudo}} authenticates users against their own password rather than that of the target user (to allow the delegation of specific commands to specific users on specific hosts without sharing passwords among them and while mitigating the risk of any unattended terminals). Some [[Unix-like]] systems implement the user group ''[[Wheel (computing)|wheel]]'', and only allow members to become root with {{mono|su}}.<ref name=levi>{{cite book | title = UNIX Administration: A Comprehensive Sourcebook for Effective Systems and Network Management | url = https://archive.org/details/unixadministrati00levi_712 | url-access = limited | first = Bozidar | last = Levi | publisher = CRC Press | year = 2002 | pages = [https://archive.org/details/unixadministrati00levi_712/page/n217 207] | isbn = 0-8493-1351-1}}</ref> This may or may not mitigate these security concerns, since an intruder might first simply break into one of those accounts. [[GNU]] {{mono|su}}, however, does not support the group ''wheel'' for philosophical reasons. [[Richard Stallman]] argues that because the group would prevent users from utilizing root passwords leaked to them, the group would allow existing admins to ride roughshod over ordinary users.<ref>{{cite web | url = https://ftp.gnu.org/old-gnu/Manuals/coreutils-4.5.4/html_node/coreutils_149.html | title = Why GNU su does not support the 'wheel' group | access-date = May 30, 2022 | url-status = live | archive-url = https://web.archive.org/web/20210621182110/https://ftp.gnu.org/old-gnu/Manuals/coreutils-4.5.4/html_node/coreutils_149.html | archive-date = June 21, 2021}}</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)