Weird that my remote ssh access open X window on the remote server but not on local client

-3

I have setup my /etc/ssh/sshd_config on the server (Mac OS) as follows:

X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost no

I can then from the client (another computer) ssh -X myaccount@myserver.com into the remote server. No error messages. The weird thing is that when I run an X window app on the server (e.g. emacs or safari or MS word), the X window actually opens on the display of the server! Not on the client!

I googled and studied, but it seems most people having problem with X11 remote access is that they cannot open an X window. Mine is different -- I can open an X window, but it's on the server side not on the client side.

Any suggestions?

Mousheng Xu

Posted 2019-05-17T02:33:33.973

Reputation: 1

Macos doesn't use X for its native display. I don't know about emacs, but programs like Safari and MS Word aren't using X to display windows, and they're not going to honor your SSH X forwarding. – Kenster – 2019-05-17T12:31:34.093

@Kenster Good to know. Thanks. – Mousheng Xu – 2019-05-17T23:40:03.963

Answers

0

When you ssh into your server, run echo $DISPLAY to see what output it's pointing to. In this instance it's likely :0.

Did you restart the sshd service?

Make sure you have XQuartz installed on your client Mac and try ssh -Y myaccount@myserver.com instead.

SHawarden

Posted 2019-05-17T02:33:33.973

Reputation: 479

echo $DISPLAY

shows:

localhost:10.0

Yes, I even tried restarting both machines. But still, the X window opens on the server.

Thanks much! – Mousheng Xu – 2019-05-17T23:37:44.037