I'm sshing from a ubuntu 14.04.1 machine into a ubuntu 14.04.3 remote machine with -X. Usually the X11 forwarding just works. But it does't on this machine. Error message:

$ eog
** (eog:7733): WARNING **: Could not open X display

$ echo $DISPLAY

However, it works when I add sudo:

$ sudo eog  

More information about the remote machine:

Kernel: 3.19.0-25-generic

SSH client settings /etc/ssh/ssh_config:

 ForwardX11 yes
 ForwardX11Trusted yes

SSH server settings /etc/ssh/sshd_config:

 X11Forwarding yes

Does anyone know what could be the cause? Or should I be looking into the config on my local machine instead?(which also has X11 enabled)


Check is any of the .files in the home is owned by root (.Xauthority might be a good candidate). If the files are owned by root, try to chwon them or delete them.

Check all the files, usually only your user should own files in your home.

| improve this answer | |
  • I checked the Xauthority. It is owned by my own user: rw------- 1 myuser myuser 108 Nov 16 14:14 /home/myuser/.Xauthority. Is there any other file that I should check? Thanks – vincent_zhang Nov 16 '16 at 21:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.