Logon On As Different User In Linux In Same Terminal Window [Quick Tip]

by Keith Dsouza | Translate | Print
Thursday, 03rd Apr 2008 | Share


Share Logon On As Different User In Linux In Same Terminal Window [Quick Tip] on Twitter Share Logon On As Different User In Linux In Same Terminal Window [Quick Tip] on Facebook Save Logon On As Different User In Linux In Same Terminal Window [Quick Tip] To Delicious Favorites Stumble Logon On As Different User In Linux In Same Terminal Window [Quick Tip] Share Logon On As Different User In Linux In Same Terminal Window [Quick Tip] on Digg Get Instant Updates as RSS Feeds from Techie Buzz

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.



Share

2 Responses so far | Share Your Opinions!

  1. Magie
    April 7th, 2008 at 9:37 pm #

    Nice tips for a new learner like me…Thanks!

    Reply to this comment

  2. Bargain Shopping
    April 14th, 2008 at 5:54 am #

    Thanks for the tip, that’s something I didn’t know and have taken note of.

    Reply to this comment

Leave a Comment

Note: We discourage users from using keywords in their names while posting comments, most of them get caught by spam, also it really would be more fruitful in knowing people who comment by their real name, rather than by using a name no one relates to. In future we reserve the right to delete comments from users using a name other than their own.

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>