[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Simple little basic config questions



Hi,

brownh@hartford-hwp.com (Haines Brown) writes:

> > each user has a session and a session key. this key is used to
> > authenticate yourself to the Xserver. Root as a key and each user
> > does.
> 
> Yes, that makes sense.
> 
> > so when you login as user and then switch to root, it tried to use your
> > root key to access the user session-- no go. 
> 
> ? When I login as user, and then "su - root," does not root then use
> its own session key? Are you saying that when I "su - root", root
> tries to use user's session key?
> 
> one solution is:
> > user% xhost +
> > user% su
> > root! xcalc
> > but this is an insecure hack since in says anyone can snoop on your
> > xserver. but if you are not on the net or have a firewall it may be used,
> > 
> > the better solution is to 'merge' your X authenticaion key database but I
> > forgot the command.
> 
> Thanks, Kev. 
> 
> My understanding of Linux is that normally you want to log in as user
> because being root carries with it certain risks. But regularly, we,
> running as user, find that we need to do something that requires root's
> privileges, and so we "su - root". That's what I read in "Running
> Linux" and elsewhere. It's what I've been doing for years. 
> 
> So I assumed that by moving from RedHats to debian, things would
> continue as before. But they have not. So, the important question that
> still remains unansered: was my installation of debian flawed, or does
> debian simply work differently than what I assume?

If you "su - root", root obtains his own environment, and reads the
.Xauthority from /root/ , and can not connect to the X server.

If you "su root", root will obtain most of his environment (As far as
possible) from the the calling user, so (at least in Debian) it uses
~user/.Xauthority an can connect to the X server.

You can also "sudo command", and "command" can acces the X server (sudo
has its own separate Debian package).

Try the following:

$ su - root
# xterm 

$ su root
# xterm

$ sudo xterm

See the "su" manual page for a complete description of the "-" argument
to "su". Note also that you don't need the "root" argument to "su" to
become the super-user, this is the default.

Hope this helps,

Jaume
-- 
Please answer to the group/list. Don't CC me.



Reply to: