LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 11-01-2009, 05:07 PM   #1
StupidNewbie
Member
 
Registered: Dec 2007
Posts: 71

Rep: Reputation: 16
SUing to LFS user doesn't ask for password


Hi all, a few quick questions about this...

I've created the LFS user and can bounce back and forth between lfs and root w/ no problems. Only thing I find strange is that even after I set a password for lfs, it doesn't authenticate when I switch from root. So I can type (as root):

Code:
su - lfs
And it just dumps me right into lfs' home directory. That's fine, but shouldn't it ask for the password I created?

In logging in, I also noticed a couple things. if I am logged in as lfs, and I su root, it will ask me for a password and just dump me to root at /home/lfs. If I su - root it dumps me to root at ~. What's the difference?

Same with the lfs user. If I su - lfs I get the lfs [~]$ prompt. If I simply su lfs with no dash I get the bash 3.2$ prompt. What's the difference there?

Thanks for any advice/insight you can provide. I am still moving forward with this so no rush on answers, just a little curious what this stuff means.
 
Old 11-01-2009, 05:13 PM   #2
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
Root doesn't need a password to su. That account is all powerful.
 
Old 11-01-2009, 10:43 PM   #3
StupidNewbie
Member
 
Registered: Dec 2007
Posts: 71

Original Poster
Rep: Reputation: 16
That's what I figured.

So what's the difference between
Code:
su - [username]
and
Code:
su [username]
? I don't really understand the explanation in the man pages...does it just dictate where you are dumped?
 
Old 11-02-2009, 04:31 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

In short:

su - -> This will give you a full blown root account. You are placed in root's home directory and all the environment related files are loaded. The - is short for -l/--login, which would give you a so called login shell.

su -> Become root but all other stuff is still the same as the original user. You are still in the dir you issued the command and the environment is still that of the original user.

To see just one of the differences try both and issue a echo $PATH.

Hope this clears things up a bit.
 
1 members found this post helpful.
Old 11-02-2009, 03:29 PM   #5
StupidNewbie
Member
 
Registered: Dec 2007
Posts: 71

Original Poster
Rep: Reputation: 16
Good explanation. Thanks!
 
  


Reply



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
simpler GUI password for Administrative tasks while retaining complex user password? workforfood Ubuntu 1 08-29-2009 06:48 AM
Locking out a user when password expires, but allowing them to change their password kaplan71 Linux - Security 5 06-27-2008 07:12 PM
Add a user with no password/or user pick password. knockout_artist Linux - Newbie 2 11-26-2007 09:08 AM
LFS LiveCD 6.2-5 root password Findus Linux From Scratch 2 08-20-2007 03:29 PM
cannot login as user 'lfs' [su - lfs] mayasedai Linux From Scratch 2 07-26-2005 06:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 12:04 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