[CS-FSLUG] How to resolve anapparent Linux crash

Brian Derr bderr at myrealbox.com
Mon Sep 6 08:19:49 CDT 2004


On Wed, Sep 01, 2004 at 09:58:01PM -0700, linux at rmf.mailshell.com wrote:
> Hmm.. That's helpful, I think. But it will probably mean more to me when I've
> used it more. What I need to remember for now is that su- is more powerful
> but restricts the number of commands I can use? When I use su/su- (one dash or two?) I won't need my root password. Okay. Thanks.

You are getting `su' and `sudo' mixed up here.  `su' = "change user ID or
become super-user" whereas `sudo' = "execute a command as another user".
The difference being that `su' will log you into the other persons
account and `sudo' lets you run a command.  Examples are in order:

   brian at hefeweizen:~$ su -
   Password: 
   root at hefeweizen$ 

I am now logged in as the root user.  (Don't forget the space between su
and -)

   brian at hefeweizen:~$ tail /var/log/maillog
   tail: cannot open `/var/log/maillog' for reading: Permission denied
   brian at hefeweizen:~$ sudo tail /var/log/maillog
   Password:
   <last 10 lines of /var/log/maillog echoed>

I, as a normal user, do not have the correct permission to read the file
/var/log/maillog.  However, root does and I can take advantage of the
`sudo' program to gain root priveleges to read the file.

As a summary, `su -' is how to login as root if you are currently logged
in as a normal user.  (Remember, you have to supply the _root_
password.)  If I only wanted to run one command as root I can save
myself extra keystrokes and run `sudo' (entering _my_ password, not
root's).  As you become more proficient in linux you'll learn there are
exceptions to this basic outline such as the -c parameter to su, but
this is a good place to start.

Brian

-- 
The just man walketh in his integrity:
his children are blessed after him.  -- Proverbs 20:7
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://ofb.biz/pipermail/christiansource_ofb.biz/attachments/20040906/de57eba3/attachment.sig>


More information about the Christiansource mailing list