Results 1 to 8 of 8
hi all, i'm logged as user 'lg' and typed su and prompts for passwd i gave the root passwd and logged into #. but when i type ifconfig - its ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 06-14-2007 #1
what's difference bw su and su -root?
i'm logged as user 'lg' and typed
su and prompts for passwd i gave the root passwd and logged into #.
but when i type ifconfig - its say no cmd found...but i can see ifconfig in /sbin/bin
then i login again as using,
su - root
now ifconfig works ...why is it so..what's difference between loggin as
su and su - root?
- 06-14-2007 #2
su doesn't add path of folders that have root access only in $PATH.
su echo $PATH exit su - echo $PATH
- 06-14-2007 #3
thanks...yes..PATH varies for two...thanks...but is that the only difference between su and su - and there is no there difference??
- 06-14-2007 #4
If you use "su", you do not inherit any of the users environmental variables and settings e.g. the path whereas using "su -" spawns a new login shell with all the users variables and settings.
- 06-14-2007 #5
'su -' changes the present working directory too. its like dropping you at root shell.
- 06-14-2007 #6
- Join Date
- Jun 2007
Cool thread , i am new member to this forum and really liked it
- 06-14-2007 #7
Welcome to the LinuxForums.
- 06-15-2007 #8