带有ssh的git clone与Fedora 29无限期挂起

时间:2019-04-04 16:46:16

标签: git github firewall fedora

我正在运行Fedora 29,并将.ssh密钥正确添加到GitHub。我知道Fedora默认运行防火墙,我尝试通过在SELINUX=disabled中设置/etc/sysconfig/selinux来禁用防火墙。

在添加我的密钥并配置了防火墙设置之后,应该很容易进行克隆,对吗?在异常长的时间后,该过程将中断,并显示以下输出:

[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.

org和repo都存在,我在其他计算机上以完全相同的方式访问它们。实际上,有一段时间,即使命令行不起作用,我仍然能够在我的机器上成功使用GitKraken从该存储库读取和写入,这很奇怪。此hack也不再起作用。

我尝试使用详细的输出进行调试,但它只是挂在这里:

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

我检查了this post,建议的解决方案是使用http:/我有2FA,因此无法使用。

有什么想法吗?

更新

根据@torek的建议,我运行ssh -vT git@github.com来尝试弄清楚该过程在哪里中断。这是输出。看来对GitHub的身份验证已成功,并且我能够对交互式会话进行身份验证,但是该过程挂起了:

...
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

1 个答案:

答案 0 :(得分:0)

但是即使您启用了2FA,也可以使用https:https://help.github.com/en/articles/accessing-github-using-two-factor-authentication#authenticating-on-the-command-line-using-https

创建令牌,并在出现提示时将其用作密码