"X11 forwarding request failed" when connecting to github.com

Note that to disable ForwardX11 just for github.com you need something like the following in your ~/.ssh/config

Host github.com
    ForwardX11 no

Host *
    ForwardX11 yes

The last two lines assume that in general you /do/ want to forward your X connection. This can cause confusion because the following is WRONG:

ForwardX11 yes

Host github.com
    ForwardX11 no

Which is what I had (and caused me no end of confusion). This is because in .ssh/config, the first setting wins, and isn't overwritten by subsequent customizations.

HTH, Dan.


It looks like you have ssh configured to always attempt to use X11 forwarding. The error message is GitHub telling you that you can't do X11 forwarding from their servers.

Look for ForwardX11 yes in ~/.ssh/config or /etc/ssh/ssh_config and set it to no. This will prevent ssh from attempting to use X11 forwarding for every connection.

Tags:

X11

Git

Ssh