Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 terdon@123.456.78.9
OpenSSH_6.2p2 Debian-6, OpenSSL 1.0.1e 11 Feb 2013
debug1: Reading configuration data /home/terdon/.ssh/config
debug1: /home/cchapple/.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

I tried

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


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?

share|improve this question

closed as off-topic by Gilles, slm, jasonwryan, Thomas Nyman, Anthon Oct 16 '13 at 5:33

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Gilles, slm, jasonwryan, Thomas Nyman, Anthon
If this question can be reworded to fit the rules in the help center, please edit the question.

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

Browse other questions tagged or ask your own question.