cancel
Showing results for 
Search instead for 
Did you mean: 

sudo command

SOLVED
Go to solution

sudo command

Hello all,
what is difference between sudo su and sudo su - command ?
Thanks in advance ...
*** Hope is good thing ***
4 REPLIES
Ganesan R
Honored Contributor
Solution

Re: sudo command

Hi,

First you should know about sudo. sudo is the tool which gives specific privilages to specific users. root can grant execute permission for few commands to selective users. For that purpuse sudo is being used.

But for executing su, sudo may not required. all users can execute su command without sudo.

Anyway come to your doubt...

"sudo su" will switch to root user, but will not inherit any root users environments settings.

"sudo su -" will switch to root user with all root environment settings.
Best wishes,

Ganesh.
Suraj K Sankari
Honored Contributor

Re: sudo command

Hi,

Same as "su" and "su -"
when we use "su test" it should not run the test users .profile but when you use "su - test" its executed test users .profile and set the env for test.

Suraj

Basheer_2
Trusted Contributor

Re: sudo command

this is same as
su user
su - user

no dash -> DONT run the user profile and the ENV settings.

with dash -> run the user profile

Re: sudo command

Thanks to all .
*** Hope is good thing ***