我正在尝试通过ssh设置XForwarding,但失败。无论我对ssh使用参数-X还是-Y,都会发生相同的结果。我得到的错误。
a@ASUS-N53SM:~$ ssh -X -p 6623 pinker@192.168.0.200
pinker@192.168.0.200's password:
Last login: Sun Feb 2 18:42:08 2014 from 192.168.0.201
/usr/bin/xauth: (stdin):1: bad display name "pinker-server:10.0" in "remove" command
/usr/bin/xauth: (stdin):2: bad display name "pinker-server:10.0" in "add" command
xdpyinfo: unable to open display "pinker-server:10.0".
在客户端文件〜/ .ssh / config中
ForwardX11 yes
在客户端文件/ etc / ssh / ssh_config中(已删除注释)。
Host *
ForwardX11 yes
ForwardX11Trusted yes
SendEnv LANG LC_*
HashKnownHosts yes
GSSAPIAuthentication yes
GSSAPIDelegateCredentials no
在服务器文件/ etc / ssh / sshd_config中(已删除注释)。
Port 6623
Port 6624
Port 6625
Protocol 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
UsePrivilegeSeparation yes
KeyRegenerationInterval 3600
ServerKeyBits 768
SyslogFacility AUTH
LogLevel INFO
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes
RSAAuthentication yes
PubkeyAuthentication yes
IgnoreRhosts yes
RhostsRSAAuthentication no
HostbasedAuthentication no
PermitEmptyPasswords no
ChallengeResponseAuthentication no
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
UsePAM yes
X11UseLocalhost no
AllowTcpForwarding yes
我发现了类似的问题,但所有答案均无效。
更新:
在服务器上,我将文件添加到/ etc / hosts中。
127.0.0.1 pinker-server
在服务器上,我安装了软件包xbase-clients
。在ssh连接echo $DISPLAY
输出上:0.0
。
现在我遇到了一个新的错误。
X11 connection rejected because of wrong authentication.
X11 connection rejected because of wrong authentication.
X11 connection rejected because of wrong authentication.
X11 connection rejected because of wrong authentication.
xdpyinfo: unable to open display "pinker-server:10.0".