On Tue, Sep 19, 2000 at 07:38:56AM -0700, Charles Hixson wrote:
> It partially depends on just what your purpose is in switching users.  The
> easiest way is to su to the new id.  I'm not really up on Linux, but on
> System V all one needed to do was:
> > su newUser
> password:
> 
> and from then on, any commands that one issued would be with the permissions
> and id of newUser.  If one does this at a text prompt, and then startx's,
> then one activates X window with the permissions of newUser.
> The drawback of this approach is that the startup script of newUser isn't
> executed, and the environment variables aren't reset, though you can execute
> it by hand.  This is also the main advantage of the method.

To execute the startup scripts, like ~/.bash_profile, use:

su - newuser


> 
> FWIW, this is basically what the su command normally does, but if you don't
> specify the name of the newUser, then it assumes that you mean root.
> 
> P.S.:  I've done a partial test of this, and have found out that if you are
> in as root, that it will not ask you for the password of newUser.  But it
> does restrict the rights as described above.  I haven't tested going from
> one normal user to another, however.

Going from one user to another, su will require a password. I suspect that
the authors thought that asking root for a password was irrelevant, since
root has far more power ($DEITY privilges) than the user you would become.

-- 

                -- C^2

No windows were crashed in the making of this email.

Looking for fine software and/or web pages?
http://w3.trib.com/~ccurley

PGP signature

Reply via email to