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 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. |
Root doesn't need a password to su. That account is all powerful.
|
That's what I figured.
So what's the difference between Code:
su - [username] Code:
su [username] |
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. |
Good explanation. Thanks!
|
All times are GMT -5. The time now is 09:30 AM. |