Bug 522 - X11 forwarding is broken after SUDO SU
X11 forwarding is broken after SUDO SU
Status: RESOLVED INVALID
Product: Sudo
Classification: Unclassified
Component: Sudo
1.8.3
IBM AIX
: high high
Assigned To: Todd C. Miller
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-11-07 15:30 MST by Natasha Brown
Modified: 2014-05-07 13:29 MDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Natasha Brown 2011-11-07 15:30:40 MST
I'm running the following versions:
OpenSSH_5.8p1, OpenSSL 0.9.8r 8 Feb 2011
Sudo version 1.8.3p1

X11 forwarding works as my user id. When I "sudo su" to root and try it, I get the following error message:

Xlib: connection to "localhost:10.0" refused by server
Xlib: PuTTY X11 proxy: MIT-MAGIC-COOKIE-1 data did not match
Error: Can't open display: localhost:10.0

SSH and SUDO were upgraded at the same time.  I confirmed that SSH is not the problem by downgrading to the previous version.  The error still exists.

Also, X11 forwarding works fine if I just "su" to root.  We need this process to work with sudo as well.
Comment 1 Natasha Brown 2011-11-07 15:45:38 MST
Previous versions:

OpenSSH_5.4p1, OpenSSL 0.9.8m 25 Feb 2010
Sudo version 1.7.2p7
Comment 2 Todd C. Miller 2011-11-07 15:52:38 MST
Sudo 1.7.2 left the HOME environment variable as-is by default.  Sudo 1.8.3 sets it to the home directory of the user the command is running as.  If you preserve HOME by default X applications should be able to find the invoking user's .xauth directory.  E.g.

Defaults env_keep += HOME

Note that preserving HOME has security implications since many programs use it when searching for configuration files.
Comment 3 Natasha Brown 2011-11-07 16:16:05 MST
Where do I go to update this setting?
Comment 4 Natasha Brown 2011-11-07 16:47:11 MST
I found it.  I add it to the sudoers file.

Thanks for the help.