switch user in terminal linux code example
Example 1: linux switch user
$ whoami
user1
$ su - user2
Password:
$ whoami
user2
$ exit
logout
Example 2: switch user ubuntu
$ su - user2
$ whoami
user1
$ su - user2
Password:
$ whoami
user2
$ exit
logout
$ su - user2