So, you’re reading an Ubuntu how to for something, and you come across the sudo command. What in the world is it, and why do you need it? The sudo command is used to allow a regular user to execute a command that requires root privileges.
In addition to the user name you provided at installation, Ubuntu creates a user called root, except it does not give it a password. This user has the power to do anything to your system. It can delete all of your system files, modify them, anything it wants to. For you to login as this root user, you must first assign it a password with which to login. This is pretty much never necessary for most users to do, so I won’t be explaining how to do that here.
There are certain tasks you may need to perform that require the root user’s level of authority. These include installing software, making changes to system configuration files, updating the system, etc. This is where the sudo command comes into play. That command tells Ubuntu that you want to execute whatever follows it, with the authority of the root user, which as you’ll remember has complete authority over your system. This is a safety feature. What this accomplishes is only giving you the root authority for the execution of that command, and not giving you all the powers of root, thereby turning you loose on your system with way too much power. It’s much better this way.
For example…
- Installing software from the command line…
sudo apt-get install conkyYou’ll then have to enter your password, and Ubuntu will execute the command. Without the
sudocommand, Ubuntu will deny you permission to run that command. - This same basic thing is happening when you are required to enter your password on the desktop. As in when you update your system by clicking on the update notification icon in the taskbar, and selecting install updates from the window that opens.
This is just one more thing that makes Ubuntu so nice and secure.
Recent...