Re: su and X question



On Wed, 2006-04-12 at 18:49 +0200, Chris wrote:
Hello,

Hi I'd like to open X-applications like the in the example below from an su
Terminal, but get an Xlib connection error. I have set up sudo so that: sudo
kwrite /etc/fstab works, but how come it doesn't in a normal su Terminal?

Thanks,

Chris

athlon:/home/stoffel# kwrite /etc/fstab
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

kwrite: cannot connect to X server :0.0


The credentials for using an X server are found in the .Xauthority file
of each user's home directory. If you run 'xauth list' from the
non-privileged user account, you will see the credentials to the X
server you are working on. However, root does not have appropriate
credentials in its .Xauthority until they are granted.

When sudo is used, the HOME directory is not modified, so even though
root is running the program, the HOME is still that of the original
user, so the .Xauthority contains the appropriate credentials.

However, when using su, the HOME changes to root's home directory, and
the appropriate credentials do not exist in ~root/.Xauthority . 'man
xauth' for more details.

There is a wrapper package for su called sux, which grants the resulting
su user permissions to the current X server when sux is called.

Casey



--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx
with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx



Relevant Pages

  • Re: su and X question
    ... The credentials for using an X server are found in the .Xauthority file ... When sudo is used, the HOME directory is not modified, so even though ...
    (Debian-User)
  • Re: Get OWA to use owa.domain.com
    ... The current setup basically just routes to the "under ... construction" page. ... I tried setting the home directory of the default ... well (credentials box just keeps popping up over and over despite the correct ...
    (microsoft.public.exchange.admin)
  • Re: Sudo w/Ticket Support
    ... over the sudoers file on most of the systems I have access to. ... People who leave workstations unattended should not have sudo access. ... I acquire credentials locally and then ssh with gssapi to ... workstation (your boss stops by with an important question and you ...
    (comp.protocols.kerberos)
  • Re: Root privilege (SOLVED)
    ... please explain how I can use sudo to tranfer X credentials .. ... sudo does not transfer X credentials like sux does. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Re: sudo vs. su (was Re: new to list, new to debian, new to linux)
    ... his system insecure. ... It's not equivalent to running as root, since you have to prefix ... privileged operations with "sudo", you have to re-auth such actions by ... you disable his or her credentials but leave the other ...
    (Debian-User)