LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-12-2004, 04:14 PM   #1
darkleaf
Senior Member
 
Registered: Jun 2004
Location: the Netherlands
Distribution: debian SID
Posts: 2,170

Rep: Reputation: 45
is there any difference/use of su - twice?


I just put in su - while I was root and it changed my prompt from debian: to root@debian. Is there any use or difference in these two?
 
Old 10-12-2004, 04:37 PM   #2
Scribbler_01
LQ Newbie
 
Registered: Sep 2004
Location: Aurora CO
Distribution: SuSE 9.1
Posts: 12

Rep: Reputation: 0
Not really, well sorta...

The su command stands for Substitute User. Using the command su <username> allows you to login as another users. Typically the - is used to identify the session as a Login Shell. So su - allows you to login as root in that shell, not just share the permissions, but your environment is shared as well.

The difference is that now you're still logged in as root, however the shell assumes you're actually two different users and not just sharing another user's permissions, so it's placing the <Substituted Username> in the prompt as a reminder.

Sound kinda confusing? Try logging in with just su instead of su - and notice the difference. Notice the difference when you enter echo $PATH in each of them. (Note, to see the difference, you should be logged in as a normal user and try both methods).

Last edited by Scribbler_01; 10-12-2004 at 04:51 PM.
 
Old 10-12-2004, 04:54 PM   #3
darkleaf
Senior Member
 
Registered: Jun 2004
Location: the Netherlands
Distribution: debian SID
Posts: 2,170

Original Poster
Rep: Reputation: 45
Yeah I noticed that one is missing everything in it's path. However the real command line doesn't change the prompt. Only a terminal.Thanks for the explanation!
 
  


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
What's the difference between dominionlife Linux - Newbie 5 10-18-2004 08:26 PM
what's the difference between ... marlor Slackware 4 06-05-2004 02:38 PM
what is the difference shanenin Linux - Software 4 10-24-2003 09:14 AM
What is the difference? drewski *BSD 5 05-21-2003 03:13 PM
What's the Difference New2Linux1978 Linux - Newbie 4 05-14-2003 06:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:11 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
Open Source Consulting | Domain Registration