Open main menu

Wikipedia β

sudo (/ˈsd/[3] or /ˈsd/[3][4]) is a program for Unix-like computer operating systems that allows users to run programs with the security privileges of another user, by default the superuser.[5] It originally stood for "superuser do"[6] as the older versions of sudo were designed to run commands only as the superuser. However, the later versions added support for running commands not only as the superuser but also as other (restricted) users, and thus it is also commonly expanded as "substitute user do".[7][8] Although the latter case reflects its current functionality more accurately, sudo is still often called "superuser do" since it is so often used for administrative tasks.

Developer(s) Todd C. Miller
Stable release
1.8.20p2 / May 31, 2017; 21 days ago (2017-05-31)[1]
Written in C
Operating system Unix-like
Type Privilege authorization
License ISC-style[2]

Unlike the similar command su, users must, by default, supply their own password for authentication, rather than the password of the target user. After authentication, and if the configuration file, which is typically located at /etc/sudoers, permits the user access, the system invokes the requested command. The configuration file offers detailed access permissions, including enabling commands only from the invoking terminal; requiring a password per user or group; requiring re-entry of a password every time or never requiring a password at all for a particular command line. It can also be configured to permit passing arguments or multiple commands.



Robert Coggeshall and Cliff Spencer wrote the original subsystem around 1980 at the Department of Computer Science at SUNY/Buffalo.[9] As of 2007 the current version is under active development, maintained by OpenBSD developer Todd C. Miller and distributed under a ISC-style license.[9]

In November 2009 Thomas Claburn, in response to concerns that Microsoft had patented sudo,[10] characterized such suspicions as overblown.[11] The claims were narrowly framed to a particular GUI, rather than to the sudo concept.[12]


Unlike the command su, users supply their personal password to sudo if necessary. After authentication, and if the configuration file permits the user access, the system invokes the requested command. By default the user's password can be retained through a grace period (15 minutes per pseudo terminal), allowing the user to execute several successive commands as the requested user without having to provide a password again.

sudo may be configured to log each command run. When a user attempts to invoke sudo without being listed in the configuration file, an exception indication is presented to the user indicating that the attempt has been recorded. The root user will be alerted via mail and an entry is recorded in the system log.[13]


The file /etc/sudoers contains a list of users or user groups with permission to execute a subset of commands while having the privileges of the root user or another specified user. The program may be configured to require a password.[14]


In some system distributions, sudo has largely supplanted the default use of a distinct superuser login for administrative tasks, most notably in some Linux distributions as well as Apple's Mac OS X.[15][16]


In association with SELinux, sudo can be used to transition between roles in role-based access control (RBAC).[17]

Tools and similar programsEdit

visudo is a command-line utility that allows editing the configuration file in a fail-safe manner. It prevents multiple simultaneous edits with locks and performs sanity and syntax checks.

The program runas provides similar functionality in Microsoft Windows, but it cannot pass current directories, environment variables or long command lines to the child. And while it supports running the child as another user, it does not support simple elevation. A true su and sudo for Windows that can pass all of that state information and start the child either elevated or as another user (or both) is included with Hamilton C shell.[18][19]

Graphical user interfaces exist for sudo, notably kdesudo, and gksudo. Other user interfaces are not directly built on sudo, but provide similar temporary privilege elevation for administrative purposes, such as User Account Control in Microsoft Windows and Mac OS X Authorization Services.[20]

doas[21] has been written in order to replace sudo in the OpenBSD base system, with the latter still being made available as a port.

See alsoEdit


  1. ^ "Sudo Main Page". News section. Retrieved 31 May 2017. 
  2. ^ Todd C. Miller (2011-06-17). "Sudo License". Retrieved 2011-11-17. 
  3. ^ a b Miller, Todd C. "Troubleshooting tips and FAQ for Sudo". Retrieved 2009-11-20. 
  4. ^ "How do YOU pronounce "sudo"?". Ars Technica. 
  5. ^ Cohen, Noam (May 26, 2008). "This Is Funny Only if You Know Unix". The New York Times. Retrieved April 9, 2012. 
  6. ^
  7. ^ "Sudo - ArchWiki" (MediaWiki). 
  8. ^ Haeder, A.; Schneiter, S. A..; Pessanha, B. G.; Stanger, J. LPI Linux Certification in a Nutshell. O'Reilly Media, 2010. p. 409. ISBN 978-0596804879.
  9. ^ a b Miller, Todd C. "A Brief History of Sudo". Retrieved 2007-03-05. 
  10. ^ Lilly, Paul. "Microsoft has Patented "sudo." Yes, the Command". Retrieved 2009-11-13. 
  11. ^ Thomas, Claburn (2009-11-16). "Does New Microsoft Patent Infringe On Unix Program Sudo? Some in the open source community suspicious of Microsoft's intent". Dark Reading. Retrieved 2010-11-29. A patent granted to Microsoft (NSDQ: MSFT) has stirred up worry that world's largest software company wants to claim Unix's "sudo" as its own. [...] In short, suspicions about this patent are overblown. 
  12. ^ Eaton, Nick (November 12, 2009). "Did Microsoft just sneakily patent an open-source tool?". Retrieved April 24, 2011. 
  13. ^
  14. ^ "Manpage for sudo". Retrieved 2007-11-04. 
  15. ^ "RootSudo". Community Ubuntu Documentation. 2011-11-08. Retrieved 2011-11-17. 
  16. ^ "Top Ten Mac OS X Tips for Unix Geeks". Retrieved 2011-11-17. 
  17. ^ "SELinux Lockdown Part Five: SELinux RBAC". Retrieved 2012-11-17. 
  18. ^ "su". Hamilton Laboratories. Retrieved August 17, 2015. 
  19. ^ "Predefined aliases: sudo". Hamilton Laboratories. Retrieved August 17, 2015. 
  20. ^ "Introduction to Authorization Services Programming Guide". Retrieved 2011-11-17. 
  21. ^ "doas". 

External linksEdit