Maximum PC

SU-SU SUDO

-

When you open the Terminal, you log on to the underlying shell via your user account, with limited access to the Terminal. Certain commands require elevated access as the root user (look for “permission denied”), and you achieve this by preceding the command with “sudo,” like so:

$ sudo apt-get install vlc

You’re prompted for your own user account password, and the command now runs—you should now be able to use “sudo” again during the current Terminal session without being prompted for your password. By the way, if you forget to include “sudo” in a command, just type “sudo !!” and hit Enter to repeat the command with sudo applied.

If you want to launch a desktop app with root privileges (such as the Nautilus file manager), use the “gksu” tool, which you first need to install as follows:

$ sudo apt-get update && sudo apt-get install gksu $ gksu nautilus

Nautilus opens as normal, but with elevated access. Make sure you leave the Terminal open while the app is running, otherwise it closes when the Terminal does. When you’re done, close the app window, then press Ctrl-C in the Terminal, which interrupts the currently running program, and returns you to the command line.

Some distros allow you to log on to the command line as the root user with the “su” tool, but Ubuntu explicitly blocks this, and for good reason. We suggest sticking with the “sudo” tool instead.

Newspapers in English

Newspapers from United States