2

My user is part of the admin group and I'm used to type sudo su to impersonate root. Unfortunately this generate a non-login shell and if I need one I need to type again /bin/bash -l.

Is there any way to have a login shell directly running a sudo command?

7

sudo -i will give you a login shell.

See the sudo manual.

About sudo su, see "Is there ever a good reason to run sudo su?".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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