LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   what does su -l do...and why would you have to sudo it (https://www.linuxquestions.org/questions/linux-newbie-8/what-does-su-l-do-and-why-would-you-have-to-sudo-it-4175537394/)

sigint-ninja 03-20-2015 07:34 PM

what does su -l do...and why would you have to sudo it
 
hi guys,

saw a video where the instructor wanted to login as root

he went...

sudo su -l

i see the -l option is -l, --login
Start the shell as a login shell with an environment similar
to a real login:

but i dont understand the significance of this...why couldnt you just go
su
login

wildwizard 03-20-2015 11:20 PM

You could but then you're pressing more buttons which takes time and time = money.

Head_on_a_Stick 03-21-2015 09:22 AM

It is possible that the root account on the system being used was locked (ie, did not have a password set) so `sudo` is needed for the non-root user's password to be accepted.

Also, just using `su` would not source the root account's shell profile (~/.bash_profile) or /etc/bash.bashrc and any application settings in /etc/profile.d/*.sh


All times are GMT -5. The time now is 09:27 AM.