Logon On As Different User In Linux In Same Terminal Window [Quick Tip]
I have been using Linux for quite some time and have been using flavors such as Red Hat, Fedora, Solaris and Ubuntu so thought it as a good option to give useful tips to my readers who are trying to learn Linux or have been using it for some time.
The first tip I wanted to talk was about quickly changing users on Linux without having to logout while you are using bash or any other command line interface.
Once you have logged into a terminal the owner of the terminal is the user you logged on with and if you wish to logon as another user there is no need to actually open another terminal window.
The su command
The su command allows users to directly login as root, but it can be used for other purposes too part of which we will talk in this post.
Changing users quickly in same terminal
Using the su command we can quickly change users in a bash terminal for that type the following command;
su – username
When you issue this command it says that change my user to the username I have provided, once you have issued this command you will be prompted for a password. The password you have to enter is not for the root user but for the username you have provided.
Once you are successfully authenticated your bash environment will change to the username you logged on with.
Want more such tips about topics I don’t cover, you can tip me about things you want me to write about.
Comment Using Facebook
5 Responses to this Article | Share your Opinions/Comments
We moderate comments to prevent spam. Moderation is done within few hours. Please try and stay on topic and refrain from using abusive language. If you think there is a problem with this post, please email the post author or send us an email at tips@techie-buzz.com with the URL and the problem you see and we will rectify it as soon as we can.


Nice tips for a new learner like me…Thanks!
Thanks for the tip, that’s something I didn’t know and have taken note of.
Thank you for your time. I would like to work with redhead and i don`t know nothing about linux.
For my school exame i have to pass Suse linux v10.2.
I would like to ask you if you got time to help me out.
Greetings,
ZazA
thanks for this helpful tip! I’m new to Linux and spent quite time to find this answer on the web!
Hi,
We are using redhat and would like to suggest that instead of the above su -l username worked there. where l as in larry/