3

I can connect to machines on my local LAN using ssh -X or ssh -Y and X forwarding works. However, when trying to connect to machines outside my LAN, X forwarding fails.

I have narrowed down the problem to these lines in my ~/.ssh/config file:

##  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

This is the output of ssh -vY when my ~/.ssh/config file contains only the lines above:

$ 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 $

Note that there is no line about requesting X11 forwarding, compare to the output below, apparently these option override the -Y or -X flag. If the ~/.ssh/config file is empty, the output of the command above includes (I am not showing the entire thing because it is very long and I think irrelevant, let me know if it is needed):

debug1: Requesting X11 forwarding with authentication spoofing.
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8

And X forwarding is successful:

terdon@server $ echo $DISPLAY
localhost:11.0

I tried

Host *
  ControlPath ~/.ssh/master-%r@%h:%p
  ControlMaster auto
  X11Forwarding yes

and

X11Forwarding yes
Host *
  ControlPath ~/.ssh/master-%r@%h:%p
  ControlMaster auto

But both give me this error:

Bad configuration option: X11Forwarding

System information:

$ 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

How can I allow X forwarding and keep the configuration options I have?

2
  • What if you use the correct name for the option? ForwardX11 = -X or ForwardX11Trusted = -Y Oct 15, 2013 at 21:42
  • Yup, that works.
    – terdon
    Oct 16, 2013 at 0:40

0

Browse other questions tagged .