Results 1 to 4 of 4
hey folks,
i would like to know how to switch between users when on the terminal. for example i can switch to root using "su" then type "password". but here ...
- 11-29-2011 #1
switching users in the terminal
hey folks,
i would like to know how to switch between users when on the terminal. for example i can switch to root using "su" then type "password". but here i want to switch to other accounts not root and switching from root without using exit.
- 11-29-2011 #2
Let's assume that there are two users on the computer... Jack and Jill.
User Jack wants to su to Jill:
Code:su Jill *enter Jills password
Done.
Provided you have the user password, you can do this for any user.
Code:su <username>
Jay
New users, read this first.
New Member FAQ
Registered Linux User #463940
I do not respond to Private Messages asking for Linux help. Please, keep it on the public boards.
- 11-29-2011 #3Linux Guru
- Join Date
- May 2011
- Posts
- 1,838
To add, if you use a '-' (or '-l', or '--login') when you su, you will make it a login shell, e.g.:
Most obviously, this will cd you into the $HOME directory of the new user. In the case of suing to root, it has the important distinction of changing to root's PATH, which includes /sbin, /usr/sbin, and the like.Code:su - joeblow
I use 'su -' so much that I literally can't type "su <USERNAME>" without automatically putting that dash there in between. I have to backspace it outa there...old habits die hard.Last edited by atreyu; 11-29-2011 at 04:51 AM. Reason: friggin typo
- 02-11-2012 #4


3Likes
Reply With Quote