Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Create a superuser shell without enabling root' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Create a superuser shell without enabling root
Authored by: notmatt on Jan 26, '04 11:52:53AM

I've always used 'sudo su' to accomplish this; is there any effective difference?



[ Reply to This | # ]
Create a superuser shell without enabling root
Authored by: ahbe on Jan 26, '04 12:14:59PM

Good tip! I just tried out sudo su and it works perfectly. I'm really surprised I have yet to see this before. It will certainly save me a bunch of time. I get so tired of having to type sudo before each command.



[ Reply to This | # ]
Create a superuser shell without enabling root
Authored by: vaiism on Jan 26, '04 12:35:20PM

I would do a 'sudo su -' tho to gain the full root account (not just becoming root) - make sure of the space between 'su' and the '-'.



[ Reply to This | # ]
Create a superuser shell without enabling root
Authored by: huzzam on Jan 26, '04 06:36:16PM

sudo su - seems to do the same thing as sudo -s. Is there a difference?



[ Reply to This | # ]
Its all in the password
Authored by: dhrakar on Jan 26, '04 08:04:13PM
The main difference is in which password you get prompted for. The su command authenticates with the password of the user you are switching to while sudo authenticates with your password. Further, if su is invoked by the root account, then it needs no password.

Thus, what is happening is that sudo prompts you for your password, and then switches you to root and invokes su to create a root shell without prompting for a root password.

[ Reply to This | # ]
You end up in different directories
Authored by: googoo on Jan 27, '04 09:46:39PM

The command "sudo -s" starts a root shell but leaves you in the same directory from which you invoked it. The command "sudo su -" logs you into a root shell in root's home directory (/var/root/). Since I am often already in the directory I want to modify, I like "sudo -s."

-Mark



[ Reply to This | # ]