Logon On As Different User In Linux In Same Terminal Window [Quick Tip]
By on April 3rd, 2008

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 Linux Tips,Change users in linux,Bash

Author: Keith Dsouza Google Profile for Keith Dsouza
I am the editor-in-chief and owner of Techie Buzz. I love coding and have contributed to several open source projects in the past. You can know more about me and my projects by visiting my Personal Website. I am also a social networking enthusiast and can be found active on twitter, you can follow Keith on twitter @keithdsouza. You can click on my name to visit my Google+ profile.

Keith Dsouza has written and can be contacted at keith@techie-buzz.com.

Leave a Reply

Name (required)

Website (optional)

Copyright 2006-2012 Techie Buzz. All Rights Reserved. Our content may not be reproduced on other websites. Content Delivery by MaxCDN