Sudo
lastmod 2026-03-22created 2015-02-0611 edits
Modifying sudo permissions
sudo-related permissions are set in the /etc/sudoers file. Do not edit this file with vi; use visudo or sudoedit instead.
Modifying the sudo PATH
The PATH set when using sudo can be changed in the /etc/sudoers file with the following line.
User information
After sudo, the SUDO_GID, SUDO_USER, and SUDO_UID environment variables give you information about the user who ran sudo.
Flags
-
-E,--preserve-env - Indicates to the security policy that the user wishes to preserve their existing environment variables. The security policy may return an error if the user does not have permission to preserve the environment.
How to use
Add user
Setting to allow a specific user to use sudo:
Add group
Setting to allow all users in a group to use sudo
Skip password
Setting to skip the password
Mount & UnMount
Setting to allow cd mount and umount with sudo
See also
- Linux
- su
- gsudo - Sudo for Windows
- capsudo - minimal sudo alternative designed around an object-capability model
- sudo-rs
Favorite site
- Registering sudo users (in CentOS)
- The sudoers file
- When you can't get root privileges with the sudo command on Ubuntu
- How to use visudo
Pages that link here