Bugzilla – Bug 522
X11 forwarding is broken after SUDO SU
Last modified: 2014-05-07 13:29:12 MDT
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.
Previous versions: OpenSSH_5.4p1, OpenSSL 0.9.8m 25 Feb 2010 Sudo version 1.7.2p7
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.
Where do I go to update this setting?
I found it. I add it to the sudoers file. Thanks for the help.