SUDO -SU ......

How do I know when I'm should use "sudo -su...." instead of just "su -..."?
paynestreetAsked:
Who is Participating?
 
Kent OlsenConnect With a Mentor Data Warehouse Architect / DBACommented:
Hi paynestreet,

sudo -su      is designed to allow a user to su to a user (such as root) to whom he normally doesn't have access.  It also allows the user to su to privileged accounts (like root) without a password.

su -             is designed to allow any user to su to any other user.  If the originating user is privileged a password is not required.


Good Luck!
Kent
0
 
arthurjbConnect With a Mentor Commented:
Also, sudo logs the accesses, and can be set up to allow a user to have access to only certain commands.

su gives total access (if you have the password).  

For example if you have a users that only needs to run a single command as root, you can set that person up in the sudoers file and they can run the command without knowing the root password of the box.

If you allow the to just us su to access root, then they need the root password, which means they basically have the master key to your entire system, and if you have the same password on other boxes, they can access those boxes too...
0
 
biraCommented:
user visudo -s  instead of editing the /etc/sudoers file.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.