I understand what su - does

  • logs you into root with the root environment
  • (as opposed to su which logs you into root with your environment)

And I understand what sudo does

  • you are root for one command

But I am unsure what this does: sudo su -

Anyone care to clarify

link|improve this question

StackOverflow is for asking programming related questions. The site you're looking for (at least for this question) is SuperUser.com – Terry Donaghe Feb 5 '10 at 22:18
feedback

migrated from stackoverflow.com Feb 5 '10 at 22:18

This question came from our site for professional and enthusiast programmers.

2 Answers

up vote 10 down vote accepted

This question belongs on SuperUser, but:

In addition to what you said, su requires the root password and sudo requires your user password

Therefore sudo su- will put you into a root environment but it will ask you for your user password instead of the root password (once sudo has given you root privileges, su - can be executed with no password).

link|improve this answer
+1 good explanation. If I config my sudo can I make it not require a password? That would made su require 'no password'? – sixtyfootersdude Feb 8 '10 at 14:46
feedback

If you are allowed (configuration of sudo) to use the su command, it asks you for your password and then logs you in as root.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.