Using the su Command

You already know that many tasks in Linux can be performed only by the root user. Most of the tasks you perform in this chapter fall into this category. It can often be inconvenient to have to log out and log back in as the root user simply to perform an administration task or two.

Fortunately, Linux provides a command that can be used to temporarily perform tasks as the root user. In its basic form, this command, su, is called without arguments. When you call su, you are prompted for the root password. If you can enter the password correctly, a subshell that is owned by the root user starts, and the shell prompt is displayed. Any commands you enter in the subshell work as though you were logged in as root. After you finish ...

Get SAMS Teach Yourself Red Hat® Fedora™ 4 Linux® All in One 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.