Running Commands as the Superuser

Before you see any more system commands, you should learn more about how to run commands as the superuser. You probably already know that you can run the su command and enter the root password to start a root shell. This practice works, but it has these disadvantages:

  • You have no record of system-altering commands.

  • You have no record of the users who performed system-altering commands.

  • You don't have access to your normal familiar shell environment.

  • You have to type the root password.

Most larger workstation installations employ a package named sudo to allow administrators to run commands as root when they are logged in as themselves. For example, if you want to use vipw to edit the /etc/passwd file, you could do it ...

Get How Linux Works now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.