ssh -X
我可以使用或ssh -Y
和 X 转发工作连接到本地 LAN 上的计算机。但是,当尝试连接到 LAN 之外的计算机时,X 转发失败。
我已将问题范围缩小到文件中的这些行~/.ssh/config
:
## Enable auto completion even when needing a password
## as long as one connnection to the server has been established.
Host *
ControlPath ~/.ssh/master-%r@%h:%p
ControlMaster auto
这是我的文件包含ssh -vY
时的输出~/.ssh/config
仅有的上面几行:
$ ssh -vYp 1234 [email protected]
OpenSSH_6.2p2 Debian-6, OpenSSL 1.0.1e 11 Feb 2013
debug1: Reading configuration data /home/terdon/.ssh/config
debug1: /home/terdon/.ssh/config line 3: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: auto-mux: Trying existing master
debug1: mux_client_request_session: master session id: 14
Last login: Tue Oct 15 20:12:24 2013 from foo.bar.net
terdon@server $ echo $DISPLAY
terdon@server $
请注意,没有关于请求 X11 转发的行,与下面的输出相比,显然这些选项覆盖了-Y
or-X
标志。如果~/.ssh/config
文件为空,则上述命令的输出包括(我没有显示整个内容,因为它很长而且我认为无关紧要,如果需要,请告诉我):
debug1: Requesting X11 forwarding with authentication spoofing.
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
并且X转发成功:
terdon@server $ echo $DISPLAY
localhost:11.0
我试过
Host *
ControlPath ~/.ssh/master-%r@%h:%p
ControlMaster auto
X11Forwarding yes
和
X11Forwarding yes
Host *
ControlPath ~/.ssh/master-%r@%h:%p
ControlMaster auto
但两者都给我这个错误:
Bad configuration option: X11Forwarding
系统信息:
$ lsb_release -icd
Distributor ID: LinuxMint
Description: LMDE Cinnamon Edition
Codename: debian
$ uname -a
Linux oregano 3.10-2-amd64 #1 SMP Debian 3.10.5-1 (2013-08-07) x86_64 GNU/Linux
$ ssh -V
OpenSSH_6.2p2 Debian-6, OpenSSL 1.0.1e 11 Feb 2013
如何允许 X 转发并保留我拥有的配置选项?