[colug-432] Psudo Sudo Su

Stephen Potter spp at unixsa.net
Mon Feb 21 15:53:13 EST 2011


On 2/21/2011 2:55 PM, Steve VanSlyck wrote:
> If I a stoopid person may ask a schmardt question....
>
> What is the difference between su and sudo? Should I expect to be able to
> use both on every distro?

su is the "switch user" (or substitute user) command.  It allows you to 
change your current user shell to another user ID.  It is original to 
(Bell) Unix Seventh Edition from around 1978-79.  As long as you know 
the password for the other account (or are currently the root user), you 
can become that user and do anything that account can do.

sudo is a command that allows you to run a command as another user.  It 
has stronger authorization control, allowing it to be set up so that a 
user can only run a single command (even specific options or arguments) 
as another use.  The person running sudo only needs to know their own 
password, not the password of the privileged account.  It was written 
for SUNY/Buffalo to be used on (Berkeley) Unix around 1980.

Generally, you would give someone sudo to a specific command, such as 
"sudo -u apache /usr/sbin/apachectl restart"; the command "sudo -u root 
/bin/sh" might be seen as almost equivalent (except you would know your 
own password, rather than root's).

-spp


More information about the colug-432 mailing list