How To Change Users in Unix
The Unix operating system is designed to be used by several different users concurrently. Each user has his own environment, which includes the system shell, the home directory and many different configuration files. It is sometimes necessary to switch to the environment of a different user to perform certain system tasks or to test certain commands. Most often, this switch will be to the superuser (root) account to perform system administration fuctions, but it can also mean switching to another user account.
Instructions
-
Instructions
-
1
Open a terminal window. The terminal window is usually found under Start -> Utilities.
-
2
Issue the command: "su -<login>." The su (switch user) command allows you to temporarily work as a different user in their environment. If you issue the su command with no login name after it, you will switch to the root (superuser) account.
-
-
3
Provide the password for the login you are switching to. If you are logged in as the root user, you will not be asked for a password when you switch users.
-
4
Perform the operations required. The switch is only applicable to the current terminal session, therefore all operations must be performed from the command line in the current terminal window.
-
5
Exit the session with the command: "exit." This is very important when you are logged in as root. If you do not exit the session, anyone else can also use that session as root.
-
1
Tips & Warnings
If you want to completely switch from one user to another, you should log out and log back in as the other user.
It is never a good idea to log in as the root user directly. You should always use the su command and be sure to exit the session when you are finished.