1

I'm running Fedora 29 and have properly added my .ssh key to GitHub. I know that Fedora runs a firewall by default, which I tried to disable by setting SELINUX=disabled in /etc/sysconfig/selinux.

After adding my key and configuring the firewall settings it should be fairly straight forward to clone, right? After an unusually long amount of time the process breaks with the following output:

[aaron@localhost repos]# git clone git@github.com:org/repo.git
Cloning into 'repo'...
Warning: Permanently added the RSA host key for IP address '192.30.253.112' to the list of known hosts.
Connection to github.com closed by remote host.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

The org and the repo both exist, and I am accessing them in the exact same way on other machines. In fact, for awhile, I was able to use GitKraken successfully on my machine to read and write from this repo, even while the command line wasn't working, which is very strange. This hack no longer works, either.

I've tried to debug with verbose output, but it just hangs here:

[aaron@localhost repos]$ git clone --progress --verbose git@github.com:org/repo.git
Cloning into 'repo'...

I checked this post and the suggested solution is to use http :/ I have 2FA so that won't work.

Any ideas?

UPDATE

Per @torek's suggestion I ran ssh -vT git@github.com to try and figure out where the process is breaking. Here is the output. Looks like authentication into GitHub is successful and I'm able to authenticate into an interactive session, but then the process hangs:

...
debug1: Offering public key: /home/aaron/.ssh/id_rsa RSA SHA256:Gam7duBv/+8VMiJH1iEYrPX5UojI09D9nlRiXpNdyjg agent
debug1: Server accepts key: /home/aaron/.ssh/id_rsa RSA SHA256:Gam7duBv/+8VMiJH1iEYrPX5UojI09D9nlRiXpNdyjg agent
debug1: Authentication succeeded (publickey).
Authenticated to github.com ([192.30.253.113]:22).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: pledge: network
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
debug1: Sending env XMODIFIERS = @im=ibus
debug1: channel 0: free: client-session, nchannels 1
Connection to github.com closed by remote host.
Transferred: sent 3508, received 2312 bytes, in 600.1 seconds
Bytes per second: sent 5.8, received 3.9
debug1: Exit status -1
aaron
  • 6,339
  • 12
  • 54
  • 80
  • 1
    Interesting. My `ssh -vT` debug info gets to the `pledge: network` point, sends env variables as above, and then gets: `debug1: client_input_channel_req: channel 0 rtype exit-status reply 0` followed by the greeting from GitHub that says it recognizes my ssh key (but of course provides no shell access). I don't know what to look at next: it's clear that your machine *can* talk to systems at GitHub, it's not clear why it *doesn't*. (In any case after the greeting I get the same `debug1: channel 0: free: client-session, nchannels 1` shutdown sequence.) – torek Apr 04 '19 at 23:19
  • @torek well, I'm glad it's not just me then... I'm also really scratching my head on this one. very strange that I was able to get some pushes and pulls running with GitKraken initially. Any thoughts on how the way GitKraken handles the ssh connection may differ from the command line? – aaron Apr 05 '19 at 21:12
  • 1
    I've never used GitKraken and know nothing about it, but that *seems* unlikely. Again, at this point I'd get a packet tracer and watch the traffic and see if your Fedora system is doing something odd. You may be able to run tcpdump or tshark right from the Fedora system. – torek Apr 05 '19 at 21:18
  • @torek roger, thanks for the tip. i'll give that a go and report back if I manage to work anything out – aaron Apr 05 '19 at 22:50

1 Answers1

0

But you CAN use https even if you have 2FA enabled: https://help.github.com/en/articles/accessing-github-using-two-factor-authentication#authenticating-on-the-command-line-using-https

Create a token and use that as the password when prompted

rdas
  • 20,604
  • 6
  • 33
  • 46
  • Cool, that's a good point, thanks for mentioning. However, I'd still like to debug what ever is going on with ssh. Any ideas there? – aaron Apr 04 '19 at 18:23
  • 1
    For debugging the git - ssh - github thing, start by simplifying away Git entirely: run `ssh -vT git@github.com` from the box in question. If you can, run a packet tracer at the same time, to see what's going on in terms of network activity. – torek Apr 04 '19 at 20:07
  • @torek Helpful, thanks. I've updated my question so that you can see the results. Of that call. Looks like the authentication into GitHub is successful prior to hanging. – aaron Apr 04 '19 at 22:40