简体   繁体   English

Git克隆不适用于ssh或https,但适用于http

[英]Git clone not working for ssh or https but is working for http

Does anyone have any clue why this would be happening. 有谁知道为什么会这样。

When I go to clone using: 当我使用以下方法克隆时:

      git clone ssh-url

it just says Cloning from 'url'... but never actually does anything. 它只是说Cloning from 'url'...而已Cloning from 'url'...但是实际上从不做任何事情。

I can however clone it with http. 但是我可以用http克隆它。 But I would like to figure out why this is happening. 但是我想弄清楚为什么会这样。

EDIT: Also, I am using mysysgit. 编辑:另外,我正在使用mysysgit。

UPDATE: I tried reradding my ssh keys to github and then ran ssh -T git@github.com to test if it worked. 更新:我尝试将ssh密钥重新捕获到github,然后运行ssh -T git@github.com来测试它是否有效。 The following is the resulkting output: 以下是输出结果:

 Permissions 0660 for '/home/thebo_000/.ssh/id_rsa' are too open.
 It is required that your private key files are NOT accessible by others.
 This private key will be ignored.
 bad permissions: ignore key: /home/thebo_000/.ssh/id_rsa
 Permission denied (publickey).

Your ssh key should have the permission 600. Otherwise SSH will not accept your private key out of security precautions. 您的ssh密钥应具有权限600。否则,出于安全考虑,SSH不会接受您的私钥。 This is the key, where you decrypt the data send from github, which is encrypted with your public key. 这是密钥,您可以在其中解密从github发送的数据,该数据已用您的公共密钥加密。

You can easily fix this by doing: 您可以通过执行以下操作轻松解决此问题:

chmod 600 ~/.ssh/id_rsa 

This should settle the issue. 这应该解决问题。

On unix the permissons (with ls -l) should look like this: 在unix上,许可证(带有ls -l)应如下所示:

-rw--------

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM