LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-31-2003, 01:49 PM   #16
Steve Cronje
Member
 
Registered: Jan 2003
Location: Canada
Distribution: Ubuntu, Mepis, Debian
Posts: 158

Rep: Reputation: 30

Quote:
Originally posted by itsjustme
Are you sure that won't just launch an additional login for barry?
I was talking about using the su command in an xterm:

Starting in an xterm as user knoppix:

knoppix@laptop:~$ su
Password:
root@laptop:/home/knoppix#

then

root@laptop:/home/knoppix# su knoppix
knoppix@laptop:~$

to get back to the prompt as user knoppix

HTH
Steve
 
Old 07-31-2003, 01:57 PM   #17
lfur
Member
 
Registered: Jul 2003
Location: Slovenia
Distribution: Slackware & FreeBSD
Posts: 209

Rep: Reputation: 30
Steve Cronje,

well X terminal and terminal in the console mode are two same things. So, when you:
su

you log in as root. There are now 2 users, you and root.
And then you said to:
su username

if you check the list of users, you will see, that there are now 3 users online:
you, root and (in your case) you again

You loged IN again and never closed the root account.
 
Old 07-31-2003, 02:04 PM   #18
itsjustme
Senior Member
 
Registered: Mar 2003
Location: Earth
Distribution: Slackware, Ubuntu, Smoothwall
Posts: 1,571

Rep: Reputation: 45
lfur is right.

Code:
bsl1@localhost bsl1]$ su -
Password:
[root@localhost root]# su bsl1
[bsl1@localhost root]$ exit
exit
[root@localhost root]# exit
exit
[bsl1@localhost bsl1]$
[bsl1@localhost bsl1]$ su
Password:
[root@localhost bsl1]# su bsl1
[bsl1@localhost bsl1]$ users
bsl1 bsl1
[bsl1@localhost bsl1]$
Notice, when I try to 'get back' after the first 'su bsl1' up there, I'm still in the root directory as bsl1.

regards...

Edit: well, I could be partially wrong also. Even if I type 'users' with the one and only initial gnome-terminal occurence, without any su or su -, it still says 'bsl1 bsl1'.

hmmmm.....

Last edited by itsjustme; 07-31-2003 at 02:12 PM.
 
Old 07-31-2003, 04:30 PM   #19
Steve Cronje
Member
 
Registered: Jan 2003
Location: Canada
Distribution: Ubuntu, Mepis, Debian
Posts: 158

Rep: Reputation: 30
Quote:
Originally posted by lfur
Steve Cronje,

well X terminal and terminal in the console mode are two same things. So, when you:
su

you log in as root. There are now 2 users, you and root.
And then you said to:
su username

if you check the list of users, you will see, that there are now 3 users online:
you, root and (in your case) you again

You loged IN again and never closed the root account.
OK, look at this:

knoppix@laptop:~$ users
knoppix knoppix knoppix knoppix
knoppix@laptop:~$ su
Password:
root@laptop:/home/knoppix# users
knoppix knoppix knoppix knoppix
root@laptop:/home/knoppix# su knoppix
knoppix@laptop:~$ users
knoppix knoppix knoppix knoppix
knoppix@laptop:~$

This was taken directly from xterm, no editing.

HTH
Steve
 
Old 07-31-2003, 06:23 PM   #20
lfur
Member
 
Registered: Jul 2003
Location: Slovenia
Distribution: Slackware & FreeBSD
Posts: 209

Rep: Reputation: 30
Steve Cronje,

my bad! Yes, as you said, there are no new users when you su to root and then su to user. But when you do that, the root acount is still there. If you check with:
ps a

you will see, that there are 3 processes running shell, but it should be only one, since it should return you where you started from. And I have noticed a similar discussion, where unSpawn said, that this must be taken as a serious security risk.
So ... yes, there are no more users, but to exit from root account you MUST use exit and not just su to normal user.

Enjoy
 
Old 07-31-2003, 08:41 PM   #21
m9dhatter
LQ Newbie
 
Registered: Jun 2003
Posts: 20

Rep: Reputation: 1
logging in again does NOT make you go back to the previous shell. it creates a new one.
for example:

myshell# su
-----rootshell# su my
----------myshell# exit
-----rootshell# exit
myshell# ( this is where you go "back" to you previous shell )

Last edited by m9dhatter; 07-31-2003 at 08:44 PM.
 
Old 07-31-2003, 08:53 PM   #22
Steve Cronje
Member
 
Registered: Jan 2003
Location: Canada
Distribution: Ubuntu, Mepis, Debian
Posts: 158

Rep: Reputation: 30
Wow, I learnt a lot from this thread! I'll be sure to use 'exit' from now on.

Thanks to all

Steve
 
Old 07-31-2003, 09:01 PM   #23
synecdoche
Member
 
Registered: Jul 2003
Location: British Columbia, Canada
Distribution: CollegeLinux 2.5
Posts: 148

Rep: Reputation: 15
To cease acting as root in a console, type exit and you'll be back to the original user.

Remember that us does not mean superuser but substitute user.

-dave
 
Old 07-31-2003, 09:12 PM   #24
itsjustme
Senior Member
 
Registered: Mar 2003
Location: Earth
Distribution: Slackware, Ubuntu, Smoothwall
Posts: 1,571

Rep: Reputation: 45
Well, I guess that about confirms it.

I said to use 'exit',
then lfur,
then m9dhatter,
then Steve Cronje,
then synecdoche

Anybody else?



Last edited by itsjustme; 07-31-2003 at 09:14 PM.
 
Old 07-31-2003, 09:16 PM   #25
Steve Cronje
Member
 
Registered: Jan 2003
Location: Canada
Distribution: Ubuntu, Mepis, Debian
Posts: 158

Rep: Reputation: 30
Quote:
Originally posted by itsjustme
Well, I guess that about confirms it.

I said to use 'exit',
then lfur,
then m9dhatter,
then Steve Cronje,
then synecdoche

Anybody else?

Yes, but you used a funny accent, didn't you ;-)

Steve
 
Old 07-31-2003, 09:21 PM   #26
itsjustme
Senior Member
 
Registered: Mar 2003
Location: Earth
Distribution: Slackware, Ubuntu, Smoothwall
Posts: 1,571

Rep: Reputation: 45
wayul, ah am frum texsiz...

 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Question About a Command? carlosinfl Linux - General 4 10-28-2005 01:51 PM
Command question satimis Linux - Newbie 2 11-24-2004 09:59 AM
Command question satimis Linux - General 8 06-23-2004 03:43 AM
cp command question satimis Linux - Newbie 1 09-13-2003 09:31 PM
Command Question gauge73 Linux - Newbie 2 02-13-2003 09:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:10 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration