X-Forwarding - Gentoo Linux Wiki
SSH Server Setup
Add the following line to /etc/ssh/sshd_config on sshd server
X11Forwarding yes ...
and reload sshd by /etc/init.d/sshd reload
Note: If you don't setup this, you may get receiving the error messages
xterm Xt error: Can't open display: your_client_name:0.0
Note: Another explanation for a Can't open display error is that the server is configured not to listen to tcp connections. Check the server is listening by doing
netstat -plant ¦ grep 6000.
Client Setup
The client does not need any extra configuration. In order to connect to the server and use port forwarding, issue one of the following commands:
ssh user@remotebox -X
ssh user@remotebox -Y
ssh -X is also known as secure X11-forwarding: it's secure, i.e., the server(running sshd) won't be able to spy on the client (key-logging etc...) ssh -Y is also known as insecure X11-forwarding: it's not secure but it can run more applications
Note: see also 'BadAtom? BadWindow?' below for other cases where -Y may be needed instead of -X.
Also, you may wish to use compression to speed things up by.
ssh user@remotebox -YC
ssh user@remotebox -XC
Forwarding Automatically
If you wish to use
X-forwarding without the -X argument, edit your /etc/ssh/ssh_config or
~/.ssh/config on ssh client machine and add an entry.
Host * (选项“Host”只对能够匹配后面字串的计算机有效。“*”表示所有的计算机。)
ForwardX11 yes
Common Errors
Error 1: No xauth data Warning: No xauth data; using fake authentication data for X11 forwarding.
This usually happens when sshing from old unix machine to new linux machine, and maybe caused by different version of SSH on server and client. Simply disable ssh forwarding
Error 2:
BadAtom? BadWindow?
Try adding to ~/.ssh/config on your ssh client machine
ForwardX11Trusted yes
没有评论:
发表评论