有人看到这个错误并知道该怎么做吗?
我正在使用终端,我在根,GitHub存储库存在,我不知道现在该做什么。
> git push -u origin master
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
有人看到这个错误并知道该怎么做吗?
我正在使用终端,我在根,GitHub存储库存在,我不知道现在该做什么。
> git push -u origin master
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
当前回答
博士tl;
在~ /。ssh / config把
PubkeyAcceptedKeyTypes=+ssh-dss
场景 如果你使用的是openSSH > 7版本,比如在MacBook Pro的触控条上,它是ssh -V OpenSSH_7.4p1, LibreSSL 2.5.0
你也有一个旧的Mac,原来有你的密钥,你放在Github上,这是可能的,这是使用一个id_dsa密钥。OpenSSH v7没有在默认情况下使用这些DSA密钥(包括这个ssh-dss),但是您仍然可以通过将以下代码放入~/.ssh/config中来添加它
PubkeyAcceptedKeyTypes=+ssh-dss
对我有用的来源是这个Gentoo通讯
现在你至少可以使用GitHub,然后将密钥修复到RSA。
其他回答
可能您的ssh-agent未启用 你可以试试
下载
http://git-scm.com/
安装它 使ssh-agent
C:\Program Files\Git\cmd
start-ssh-agent
对我来说,我试过这个
eval "$(ssh-agent -s)"
然后我就跑
ssh-add ~/.ssh/path-to-the-keyfile
为了生成密钥,你可以运行
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
这将生成一对密钥(Public和private)。
您可以将此密钥存储到github以了解更多信息,添加一个新的SSH密钥到您的github帐户
我希望它能帮助到其他人:)
GitHub无法验证你的身份。所以,要么你没有安装SSH密钥,因为你还没有在你的机器上设置一个,要么你的密钥没有与你的GitHub帐户相关联。
您还可以使用HTTPS URL而不是SSH/git URL来避免必须处理SSH密钥。这是GitHub推荐的方法。
此外,GitHub有一个专门针对该错误消息的帮助页面,并更详细地解释了您可以检查的所有内容。
使用Https是可以的,运行git config——global credential。帮助wincred创建一个Github凭据帮助存储您的凭据为您。如果这不起作用,那么您需要编辑.git目录中的配置文件,并将原始文件更新为https url。
查看github文档的链接。
你可以试试这种方法……
选择其他链接