Red Hat Linux 7 Unleashed

Red Hat Linux 7 Unleashed

By William Ball

Working as root

In order for the system administrator to perform his many duties, he can assume super-user privileges to perform tasks not normally available to the average user of the system. The superuser performs these tasks as user root. root is a special user account that is available on every UNIX system. This special user has full access to the system. The system ignores all permissions when responding to commands from the root user, providing read, write, and execute permissions to every file and device known to the system.

What does the power of root mean in practical terms? The command rm -rf / run as root could delete the entire system. It also means that root has access to all data. Complete access is helpful for backing up and restoring data, performing system maintenance, and even performing security tasks. Many commands, with certain parameters, are ideal to hand off to the users; bringing up print queues is a good example. Unfortunately, with different parameters the same commands could take down the print queues or delete other users' printouts. The root account is all-powerful. The root user keeps the system up and running as a stable environment; but a root user can also destroy the system and all data contained therein.

It is because of this ability to manipulate the system that, as system administrator, you should take great care when you are using the root account—not only when you are using and modifying the system, but also when you are changing passwords.

A password is the identification that the operating system uses to determine whether a user attempting to log in with a certain user ID is authorized to use that account. Anyone who knows the root password can control the entire system. A user can boot a Red Hat Linux system that is left unsecured from disk and change the root password even if he does not know it.

That is correct—you can change the root password this easily:

  1. Boot the system with the boot disk.
  2. Mount the root partition.
  3. Edit the /etc/passwd file to remove the password for root.
  4. Reboot from the hard disk.
  5. Set a new password for root.

This process is nice and convenient if the Red Hat system happens to be a system in someone's home with no other purpose than teaching the user how to use Linux. This process is a problem, however, for a Red Hat system used as an ISP in an unsecured location in a public building.

Because of the power of the root account, a user on the system who has access to the root password should not log in directly as root. To perform a task that requires root authority, the user should log in with his regular user account and su to root to perform the task. Then, the user should return to his normal account. This procedure helps ensure two things. First, it keeps the user from accidentally performing actions that he did not intend but are allowed by root. Second, it provides logging. /etc/login.defs is the file that defines, among other things, the su log, the failed login log, and the list of who logged in last. Although logging does not stop an action, it will at least help determine who performed the action.

Share ThisShare This

Informit Network