Quando tive esse problema, descobri que precisava adicionar essas linhas a ~/.ssh/config
:
Host *
ForwardX11Trusted yes
Você deve modificar o * para algum tipo de padrão de host, de forma que ele não esteja habilitado para todas as conexões ssh.
Você pode querer alterar a opção ForwardX11Timeout. De man ssh_config
:
ForwardX11Timeout
Specify a timeout for untrusted X11 forwarding using the format
described in the TIME FORMATS section of sshd_config(5). X11
connections received by ssh(1) after this time will be refused. The
default is to disable untrusted X11 forwarding after twenty minutes has
elapsed.
ForwardX11Trusted
If this option is set to “yes”, remote X11 clients will have full
access to the original X11 display.
If this option is set to “no”, remote X11 clients will be considered
untrusted and prevented from stealing or tampering with data belonging
to trusted X11 clients. Furthermore, the xauth(1) token used for the
session will be set to expire after 20 minutes. Remote clients will
be refused access after this time.