How to switch to another user using sudo in Ubuntu 12.04 shell

How to switch to another user from the Ubuntu 12.04 command-line shell without the password of the target user. Must have sudo permissions.

 Posted April 12, 2016

Usage: sudo -u <username> <shell>

Assuming your account has root/sudo permissions:

You may have to type in your password (not the password of the account you’re switching to.)

Just type “exit” to get back to your original session:

 

Leave a Reply

Your email address will not be published. Required fields are marked *