Linux-tips

Fork me on GitHub

I. Linux tips

4. Having remote graphic applications with ssh

After failing to setup correctly openserver to get graphic access from another computer, I discovered the X option of ssh. All you need to do is to run a ssh server on the computer you want to connect on and that's good! You also have to allow the X11 forwarding on both server and client sides.

Client side

Go to the ~/.ssh/config file and set ForwardX11 parameter to yes like this:

# some other parameters...

ForwardX11 yes

# ...

Server side

Go to the /etc/ssh/sshd_config file and set ForwardX11 parameter to yes like this:

# some other parameters...

ForwardX11 yes

# ...

You also need to have xauth installed (but it's very uncommon to not have it).

And finally, you have to restart ssh service. In case you forgot how to do so:

> sudo /etc/init.d/ssh restart
# or:
> sudo service ssh restart
# on systemd:
> systemctl restart ssh

Then you can connect to the remote computer like this:

> ssh login@ip -X

For now, nothing different should have happened. But if you start a graphic application, it'll start directly on your computer.