Chapter 10. Managing users

su username

(Switch User), change to a different user.

Use su - to switch to root or su username, to switch to a different username.

TipUsing sudo
 

Its often considered better practice to use the sudo command rather than switch to the root user

The sudo command allows you to perform actions as root but logs the actions you take (so you can trace anything that was done to the system by yourself or others). sudo has a very good manual page which provides plenty of information about it.

You use sudo similar to how you execute a normal command with sudo prepended to it, for example:

 sudo rpm -U myrpm.i386.rpm 

This would allow you to install a rpm even if you have the correct sudo access

Note that if you want to return to your original user you don't use su again, type exit or press CTRL-D .

Simply typing su will give you some root privileges, but there are minor complications relating to environment variables. It's generally considered better practice to use su - because it has no restrictions.

root

The superuser. This user has power over everything and all, and can do anything with the system (including destroy it, and of course fix it :)). This user is used to perform most administration functions on the system.

mirror server hosted at Truenetwork, Russian Federation.