[OT] sudo, why not su?

MrKnisely mrknisely at mrknisely.is-a-geek.org
Sun Aug 7 15:18:14 UTC 2005


Perhaps it is important to remember that althoug you can do the same 
tasks with two commands, they are not meant to be replacements for one 
another.  Per man:

su - Change user ID or become super-user

sudo - execute a command as another user

Note that with su you are becoming that other user.  Most of us are 
familiar with becoming root, since we often run single user machines and 
need to run a few commands as root; however, in a multi-user enfiroment 
I've used su to become useres to test secutity I've put in place.  Now, 
lets take this a step further.  Is it a good idea for user1 to become 
user2?  No, user1 shoud only be able to become user2 if user1 is also 
able to become root, since root could do this anyway.  This is why su 
requires root's password. 

Sudo, on the other hand, is just to allow a user to run a program with 
the elevated privlage of root.

Now, there is a way around this.  "sudo su"  Again, I don't recommend 
this, but it works.  Perhaps an alias for su to this command is what you 
want. 

Mike K.





More information about the ubuntu-users mailing list