On Sun, Feb 28, 2010 at 12:52:01PM -0700, Denis Dupeyron wrote:
> Some systems are configured with a random root password. After a while
> you get tired of doing 'sudo <command>' all the time and would like to
> become root but you can't because you don't know the root password.
> One way around that is 'sudo su -' which allows to become root using
> your user password.
 
 Actually, by default, sudo command uses your user password (it does
 here anyway), and su - uses the root password.  afaik sudo can be
 configured to require the root password in the sudoers file, but it
 doesn't by default.  To test it, run this as a user:

 sudo -i

 That should ask for a password.  Try your user password there.  Once
 you authenticate, you will be put in a shell with root's environment.

 On the other hand, "su -" requires the root password and does the same
 thing as "sudo -i".

In affect, when you run "sudo su -" what you are doing is running sudo
and authenticating to it.  Then you are running "su -" as the command
you want sudo to run as root.

William

Attachment: pgpabVHpznkXg.pgp
Description: PGP signature

Reply via email to