LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 10-04-2004, 05:33 PM   #1
xtremcoder
LQ Newbie
 
Registered: Jun 2003
Posts: 14

Rep: Reputation: 0
Log Out root Then Log In As Other User


How do I do this?
 
Old 10-04-2004, 05:38 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,128

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
From the GUI or the command line? On the command line, logout, exit, or CTRL+D will work. In the GUI, logout is an option under a menu somewhere, generally. After you have logged out, the login prompt will return and you can login as another user Note: root can open sessions for any other user without specifying a password. In a terminal, as root, type su <user>, and you will become that user. This is handy if you're working as root (which you shouldn't be doing too much) and you need to quickly become another user. Normal users can do this trick, too, but they have to know the password of the user they're su'ing to.
 
Old 10-04-2004, 05:41 PM   #3
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: Tupelo, MS
Distribution: Gentoo
Posts: 6,926

Rep: Reputation: 124Reputation: 124
The command "su" means switch user. The normal user will
have a $ prompt, while root will have a # prompt. If you
only have 2 users and are logged in as a normal user, when
you issue "su" you'll simply be asked for the other user (root)
password like this
Code:
mingdao@james:~$ su
Password:
root@james:/home/mingdao# exit
exit
mingdao@james:~$ su
To logout as root simply issue "exit"
 
Old 10-04-2004, 05:49 PM   #4
xtremcoder
LQ Newbie
 
Registered: Jun 2003
Posts: 14

Original Poster
Rep: Reputation: 0
I'm doing this remotely through SSH, so if I type exit it will close my client.

I tried logout but it said I had to use exit, and that closes my client.
 
Old 10-04-2004, 11:01 PM   #5
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: Tupelo, MS
Distribution: Gentoo
Posts: 6,926

Rep: Reputation: 124Reputation: 124
Quote:
Originally posted by xtremcoder
I'm doing this remotely through SSH, so if I type exit it will close my client.

I tried logout but it said I had to use exit, and that closes my client.
My example below might be confusing, but look. That comp has 2 normal users (mingdao and james)
and of course root.

If you issue these three commands on your system ->

man ssh
man exit
(terminate the current process)
man su
(su is used to become another user during a login session. Invoked without a username, su defaults to becoming the super user.)

they may clarify what I might have confused for you.

Code:
mingdao@james:~$ ssh 192.168.1.11
mingdao@192.168.1.11's password:  <- mingdao logged in
Last login: Tue Oct  5 11:41:14 2004 from 192.168.1.31
Linux 2.4.26.
mingdao@paul:~$ su  <- su is switch user
Password:  <- I entered the password for root, so it su'ed to root
root@paul:/home/mingdao# exit
exit  <- it exited to the user who logged in, mingdao
mingdao@paul:~$ su james  <- switched users to james
Password:
james@paul:/home/mingdao$ exit
exit  <- exited james to mingdao, who started the ssh session
mingdao@paul:~$ su root
Password:  <- su (switch user) to root
root@paul:/home/mingdao# exit
exit  <- exit from root to mingdao
mingdao@paul:~$ su root
Password:
root@paul:/home/mingdao# su james  <- switched users to james
james@paul:/home/mingdao$ su mingdao
Password:  <- switched users to mingdao by entering his password
mingdao@paul:~$ exit
exit  <- exited james (where root su'ed to) to mingdao
james@paul:/home/mingdao$ exit
exit  <- exited mingdao to root, who logged in last
root@paul:/home/mingdao# exit
exit  <- exited root to mingdao, who originally started the ssh session
mingdao@paul:~$ exit  <- exited the ssh session, because mingdao started it
logout
Connection to 192.168.1.11 closed.
mingdao@james:~$
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cant only log in as root after user log-in. ADJenkins Linux - General 2 11-17-2004 04:18 PM
How to log in as root user Ree Linux - Newbie 4 09-30-2004 04:35 PM
Can only log in as root user?!?! eviltama Debian 10 05-29-2004 05:29 AM
Root user can't log in Phaethar Linux - General 3 05-04-2004 10:05 AM
Can't log in as user, only as root trentk Linux - Newbie 5 02-28-2002 08:27 PM


All times are GMT -5. The time now is 12:36 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration