Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm able to login to sever using

ssh -X Hostip

but when i run the command xclock it give me this error

Error: Can't open display: localhost:11.0

I check my Display value using

echo $DISPLAY

and the result is

localhost:11.0

And X11 forwarding is set to YES in sshd_config file

X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes

Any advice what I'm missing here?

share|improve this question
1  
Have you tried -Y instead of -X? –  Flup Jul 22 '13 at 11:35
    
Also, make sure you understand the implications of using -Y instead of -X. You may also want to look at xhost. –  Michael Kjörling Jul 22 '13 at 11:36

1 Answer 1

Use -Y. From the man page on ssh:

-Y Enables trusted X11 forwarding. Trusted X11 forwardings are not subjected to the X11 SECURITY extension controls.

If you're still having problems though, you can try setting $DISPLAY to your local box's IP:

$ export DISPLAY='<ip_address>:11.0'

It may work to set it as

$ export DISPLAY='127.0.0.1:11.0'

People seem to have this problem commonly when ssh'ing from Mac OS X.

share|improve this answer
    
Using XQuartz I was unable to use the -Y flag. "X11 connection rejected because of wrong authentication." –  Erik Feb 21 at 4:01
    
even after trying your other suggestions, I'm unable to open a display. –  Erik Feb 21 at 4:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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