I'm trying to connect from my mac (Xquartz installed) to a ubuntu server. I use the -Y
option with ssh. When I ssh to the server and run any graphical application for example xclock, I get the following error
$xclock
Could not find ':' in DISPLAY: 1
Error: Can't open display: localhost:10.0
X11 forwarding is set in sshd_config
$ grep -i X11Forward /etc/ssh/sshd_config
# Setting X11Forwarding to "yes" permits encrypted X connections.
X11Forwarding yes
and,
$ echo $DISPLAY
localhost:10.0
Can someone help me in this regard.
Best Answer
I'll give a generic answer here, because other people might be struggling to setup X forwarding on a Mac here. I think in your specific case, try to run ssh from XQuarts instead of running it from the terminal. Also make sure you have XForwarding set on the serverside and restart sshd after adjusting it.
Prerequisites to run X applications on OS-X:
/etc/ssh/sshd_config
):X11Forwarding yes
(don't forget to restart the ssh server after editing the sshd_config file).Running X over ssh:
ssh -X [username]@[servername]
(you can also use-Y
instead of-X
)xeyes
for example to have X look back at you.Troubleshooting:
-v
or even-vv
or-vvv
and look for clues). Don't tamper with the $DISPLAY setting yourself, because it's the effect of ssh not being able to establish a tunnel, not the cause.