[arch-general] SSH. Can't open Xapps when su'ed to root

Michael Towers gradgrind at online.de
Sun Feb 10 14:06:55 EST 2008

Nigel Henry wrote:
> I'm still looking at the jacman problem, and have sometimes found that apps 
> that won't work on the machine they are installed on, will work if I ssh into 
> the machine, and run them on another.
> IIRC I had problems initially using ssh when I installed Archlinux (don't 
> panic), but found some info somewhere or other, as below.
> Comment out "ALL: ALL: DENY" line in /etc/hosts/deny
> Add sshd to /etc/rc.conf daemons list
> Run /etc/rc.d/sshd start
> Now I can ssh into archlinux (this is just local, not from the Internet). I 
> have uncommented the following lines in /etc/ssh/sshd_config
> X11Forwarding yes
> X11DisplayOffset 10
> I can open Xapps as user (gedit, jacman,etc), but not when I su to root, as 
> below for gedit.
> [djmons at myhost ~]$ su
> Password:
> [root at myhost djmons]# gedit
> X11 connection rejected because of wrong authentication.
> cannot open display:
> Run 'gedit --help' to see a full list of available command line options.
> [root at myhost djmons]#
> Same goes when I try to open jacman when su'ed to root.
> I tried accessing Xapps as root with Fedora 8, which is on the same machine as 
> Archlinux, and they open ok.
> I have compared the sshd_config on both F8, and Archlinux, and can't see any 
> apparent differences between the two.
> Anyone have any suggestions as to what may be the problem?
> All a bit puzzling.
> Nigel.

I don't think this has anything to do with ssh - you'd get the same 
problem without it. It's x-server access. You can use kdesu/gksu/sux or 
xhost. Or, in the case of ssh, you can ssh to the root account on the 
remote machine (ssh [-Y] root at blah).

More information about the arch-general mailing list