43

I'm new to both git and OSX, coming from Ubuntu and svn.

When I do a "git push" from the OSX terminal shell, I get the following warning:

folklore$ git push origin master
Warning: untrusted X11 forwarding setup failed: xauth key data not generated
Warning: No xauth data; using fake authentication data for X11 forwarding.
Counting objects: 7, done.

It seems to be working fine, its just a warning. But I dont' understand it. Why is there any X11 in play here?

I've checked my .ssh/ keys and they are properly 600.

I guess I could just keep ignoring the warning, but I'd rather clean it up. And perhaps learn a bit.

Andreas Fester
  • 36,091
  • 7
  • 95
  • 123
fishtoprecords
  • 2,394
  • 7
  • 27
  • 38

2 Answers2

47

This is an ssh issue, not a git issue. What you are seeing is not a git whine, it's a valid warning from your ssh client. You should ensure that your ssh config doesn't attempt X11 forwarding by default (git doesn't need it), or at least turn it off for the host you are connecting to.

In your ~/.ssh/config try:

ForwardX11 no

either in the host specific section or globally.

CB Bailey
  • 755,051
  • 104
  • 632
  • 656
  • 1
    Thanks, but I think I'm mangling my ssh options This is from my .ssh/config Host github HostName github.com User pfarrell IdentityFile ~/.ssh/id_rsa ForwardX11 no pfarrell@MBP:~/.ssh$ ssh git@github.com Warning: untrusted X11 forwarding setup failed: xauth key data not generated Warning: No xauth data; using fake authentication data for X11 forwarding. – fishtoprecords Jun 12 '11 at 01:37
  • You saved my life, otherwise I will use source tree – 水清木华 Nov 02 '15 at 06:06
25

If you want to get rid of this message for github (as deduced from your comments), your ~/.ssh/config should contain:

Host *github.com
   ForwardX11 no

As the value after Host needs to be a pattern to match the hostname given to ssh. (You could e.g. also use Host *github.* ).

Of course other elements (HostName, User, etc.) can be added to this host as well.

Anthon
  • 69,918
  • 32
  • 186
  • 246
  • 2
    Note that your github configuration should appear *above* your global options to take precedence over them. – Felix Apr 06 '16 at 07:00
  • 1
    @felix Yes, that follows from the fact that the first obtained value will be used for each parameter. – Anthon Apr 06 '16 at 07:04