Enable X11-Forwarding on VPS
How to enable X11-Forwarding on a Virtuozzo VPS
CentOS
Note: This was tested on CentOS 7.9 but should apply to all available versions. Some minor differences may be present.
- Install Xauth with
yum install xorg-x11-xauth - Make sure X11Forwarding is enabled by running
grep X11Forwarding /etc/ssh/sshd_config, the output should look like:X11Forwarding yesIf the output isX11Forwarding no, edit the value in the sshd config withvim /etc/ssh/sshd_configand restart sshdservice sshds restart - Connect to the VPS
ssh -X user@ip - Install an X application to verify that it works (for example:
yum install xclockand then run it withxclock)
Ubuntu
Note: This was tested on Ubuntu 20.04 but should apply to all available versions. Some minor differences may be present.
On a Ubuntu 20.04 VPS the package xauth is already installed by default.
- Make sure X11Forwarding is enabled by running
grep X11Forwarding /etc/ssh/sshd_config, the output should look like:X11Forwarding yesIf the output isX11Forwarding no, edit the value in the sshd config withvim /etc/ssh/sshd_configand restart sshdservice sshds restart - Connect to the VPS
ssh -X user@ip - Install an X application to verify that it works (for example:
apt install xarclockand then run it withxarclock)
Debian
Note: This was tested on Debian 11.2 but should apply to all available versions. Some minor differences may be present.
On a Debian 11.2 VPS the package xauth is already installed by default.
- Make sure X11Forwarding is enabled by running
grep X11Forwarding /etc/ssh/sshd_config, the output should look like:X11Forwarding yesIf the output isX11Forwarding no, edit the value in the sshd config withvim /etc/ssh/sshd_configand restart sshdservice sshds restart - Connect to the VPS
ssh -X user@ip - Install an X application to verify that it works (for example:
apt install xarclockand then run it withxarclock)