What is the purpose of the sudo
command in Linux?
Install new software packages
Execute with elevated privileges
Display the contents of a file
Correct Incorrect Unanswered
Answer Description
The sudo command in Linux is primarily used to execute commands with elevated privileges, often required for administrative tasks such as installing new software packages or making system-level changes.
For example if the user lin
does not have write permissions on file jims_file.txt
, but does have permissions to elevate to the superuser account sudo
could be used to modify the file: lin@crucial: $ sudo rm jims_file.txt
Wikipedia
sudo ( or ) is a program for Unix-like computer operating systems that enables users to run programs with the security privileges of another user, by default the superuser. It originally stood for "superuser do", as that was all it did, and it is its most common usage; however, the official Sudo project page lists it as "su 'do' ". The current Linux manual pages for su define it as "substitute user", making the correct meaning of sudo "substitute user, do", because sudo can run a command as other users as well.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 (typically /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.
Sudo - Wikipedia, the free encyclopedia