sudo
SystemBeginner In real LinuxRun a command as the administrator (root)
Name: sudo = superuser do (also read as "substitute user do")
This command needs a real Linux system; you can practise it in real Linux mode.
Description
sudo runs a command as root (or another user with -u), asking for **your own** password. Who may run what is defined in /etc/sudoers, which you should edit with visudo.
Compared with logging in as root it raises privileges only when needed and keeps a log, so it is safer. Your password is remembered for a while (15 minutes by default).
Syntax
sudo [OPTION]... COMMANDCommon options
| -u / --user USER | Run as another user |
| -i / --login | Start a root login shell |
| -s / --shell | Start a shell as the target user (keeping your directory and environment) |
| -E / --preserve-env | Keep your environment variables |
| -l / --list | List what you may run |
| -v / --validate | Renew the password timeout without running anything |
| -k / --reset-timestamp | Make the next sudo ask for the password again |
| -e / --edit | Edit files as root (like sudoedit, with your own editor) |
| !! | (bash) Re-run the last command with sudo: sudo !! |