In today’s article, we will look at how to Switch User On Linux.
In Linux, we can create multiple users and switch between them.
While switching, we can switch without changing the directory of the user that we want to switch to, or we can switch to the home directory of the switched user.
With the command below, we can switch to the user we want to switch to, and in addition, we can switch by connecting to the home directory of the switched user.
1 | su - user |
1 | su - farukerdem |
With the help of the following command, the directory of the connected user remains constant and we switch with the user.
1 | su farukerdem |
We can use the exit command to exit the connected user and operate with the previous user.