Link to home
Start Free TrialLog in
Avatar of jskfan
jskfanFlag for Cyprus

asked on

Su and Sudo in inux

I have been reading about the difference between Su and Sudo command in linux
it says with Sudo, if the user is in the Sudoers file, he will enter the password and he will be able to run a single command. with Su the user will enter the root password and will be able to run any command.

So if I know the root password, then I do not need to run Sudo at all…correct ?
anyone to clear the confusion on this ?

Thanks
SOLUTION
Avatar of omarfarid
omarfarid
Flag of United Arab Emirates image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jskfan

ASKER

so if you are logged in as root , you do not need to run sudo ?
if you are logged in as regular user, then you type  su to run something  as root, you will stay logged in as root for the rest of the commands that you will run , until you specifically type again su to switch to regular user ???

 if you type sudo to run a command, then after that command is executed , your privileges will go back to the regular user ????

is this correct ?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jskfan

ASKER

Thank you