Prerequisites

The xauth package must be installed on the server in order to forward X11 packets to the client. If you want to test xclock, you will have to install that as well.

Server

On the server, you will need to enable X11Forwarding in /etc/ssh/sshd_config. Look for a line with X11Forwarding and set it to yes. If it is already there and commented out, you need to uncomment it by deleting the leading #.

grep X11Forwarding /etc/ssh/sshd_config <===> otestuje zda je na kompu zapnuty X11Forwarding

/etc/ssh/sshd_config
X11Forwarding yes


Do not forget to reload the ssh service in case you had to change the configuration file.
sudo systemctl restart ssh
nebo
sudo service ssh restart

Client

pokud chceme spouste programy pres X11 musime pri spusteni zadt flag -X
ssh -X Tato e-mailová adresa je chráněna před spamboty. Pro její zobrazení musíte mít povolen Javascript.