[Courses] [Networking] Lesson 1

kathee kat at ezunx.com
Thu Mar 20 06:30:24 EST 2003


On Thu, 2003-03-20 at 05:11, Sue Stones wrote:
> On Thu, 20 Mar 2003 03:40 am, Hamster wrote:
> > LESSON 1 - Welcome!
> ## Homework ##
> 
> > 1. If you don't understand the difference between "su" and "su -", have a
> > read of the manpage for su (man su) and write to the list asking about
> > things in the manpage you don't understand.
> 
> I did that, but I didn't understand the answer.  So I tried it out.
> "su" loged me in as root, and left me in the current directory
> "su -" put me into the /root directory (the eqivalent of "su" followed by cd)
> 
> I would have thought it would be more usefull to be in the / directory.
> 
> sue
> 
> _______________________________________________


And it not only changes your directory, but your "Environment" -- the primary 

difference of su and su - is to think of someone trying to impersonate you. 

There are two ways -- in voice only, and completely. 

If I tried to impersonate you on stage, I might simply change my voice
and speak in your words. To some, this would appear convincing. But if I
wanted to walk to a store and use your credit card where there know you,
it would be impossible.  This is "su"

If I were to "su -", not only would my voice change, but my clothes,
height, weight and total appearance. I could now walk in the store and
use your credit card without a problem. I have altered not only my
voice, but my whole local environment.

In unix, the environment not only consists of your directory, but of all
the variables associated with "env" or "printenv". To see the
difference, try the following with both su and then su - :

env (or printenv)
whoami

I hope this helps.
Kat




More information about the Courses mailing list