1

I'm using Ubuntu16 inside a Docker image on top of CentOS6 in order to be able to run certain desktop apps that doesn't run on top of CentOS6.

As an example, to run the Dartium browser, I do:

ssh -X -p 32768 [email protected] dartium

To run a special version of firefox, I do:

ssh -X -p 32768 [email protected] firefox-mod

etc, etc, etc - for each app I want to run on Ubuntu that doesn't work on CentOS6, I simply run it via ssh -X

One of the applications requires access to a git repo. I've setup all the SSH keys that rerequired to make it work and this is as far as I get:

$ git fetch origin
/etc/ssh/ssh_config: line 55: Bad configuration option: x11forwarding
/etc/ssh/ssh_config: terminating, 1 bad configuration options
fatal: Could not read from remote repository.

Please make sure you have the correct access rights

The git remote is setup to run via SSH, when it runs, it obviously includes the x11forwarding parameter which is required for ssh -X to work. Removing x11forwarding config makes it work again, but then X11 Forwarding stops working.

ssh -T git@gitlab._____.____ -p 22 
/etc/ssh/ssh_config: line 55: Bad configuration option: x11forwarding
/etc/ssh/ssh_config: terminating, 1 bad configuration options

Is there a way to turn off the x11forwarding only for the git command?

2
  • 1
    Rather than enabling X11 forwarding for all hosts, why not enable it selectively in a host section?
    – Daniel B
    Jun 3, 2016 at 15:59
  • I could probably do that as well Jun 3, 2016 at 16:44

1 Answer 1

3

There is no such option as x11forwarding in ssh_config (it is server option for sshd_config). It is ForwardX11 in ssh_config, as visible from manual page. Fix this typo in the /etc/ssh/ssh_config and it will work for you.

You can also set up Host blocks:

Host gitlab._____.____
  ForwardX11 no

in the ssh_config to disable that only for this host.

2
  • That fixes it and X11Forwarding continues to work, yay :-D Thanks Jakuje! Jun 3, 2016 at 15:13
  • Just a clarification. You need to put exclusion at the top rather than bottom of "Host *". I simply used "Host github.com" under which I put "ForwardX11 no"
    – bikram
    Aug 14, 2022 at 6:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .