If you are a root user and interested in switching to another user account, you can easily do it without requiring to know their password because you are a penguin.
However, if you are the user with sudo privileges and are interested in switching to another user account or root user, you are required to know your current password.
If you are a standard user without sudo privileges, you are still able to switch to another user account or to the account of the root user, but only if you know their password.
This is all done using the “su
” command in Linux.
Tutorial Details
Description | Switching to Another User |
Difficulty Level | Moderate |
Root or Sudo Privileges | Yes |
OS Compatibility | Ubuntu, Manjaro, Fedora, etc. |
Prerequisites | su |
Internet Required | No |
Switch from Root to Another User Account
If you are a root user and interested in logging into another user’s account, use the following command with their username.
$ su [USERNAME]
Switch from Sudo User to Root User Account
If you are a user with sudo privileges, you can easily login to the root user account by knowing your current password, as shown.
$ sudo su
Output:
Switch from Sudo User to Normal User Account
If you want to peek into another user’s account, find out their username and know your current password, and specify both as shown.
$ sudo su jake
Output:
Switch from Normal User to Root User Account
If you are not a sudo user, you are still able to switch to the root user account only if you know the root account password as shown.
$ su
Output:
Switch from Normal User to Normal User Account
If you are interested in switching to another user account from your current account, which does not have sudo privileges, you must know their username and account password in order to login.
$ su jake
Output:
Exit from the Current Logged-in User Account
After switching to another user account to get back to your actual account, execute the exit
command in your current terminal session.
That’s all for now. Bye bye.
Join The Conversation
Users are always welcome to leave comments about the articles, whether they are questions, comments, constructive criticism, old information, or notices of typos. Please keep in mind that all comments are moderated according to our comment policy.