有人看到这个错误并知道该怎么做吗?
我正在使用终端,我在根,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.
当前回答
这可能是由于您的SSH密钥/ GPG需要在您的组织github或gitbucket站点上更新。 遵循以下步骤来鞋底:
在cmd:键入>> $ ssh-keygen -t rsa -C "your_email@example.com"(结果创建id_rsa和id_rsa.pub) $ ssh-add ~/.ssh/id_rsa 猫~ / . ssh / id_rsa。Pub并复制密钥,然后到你的org bitbucket/ github站点,并将其粘贴到SSH密钥上
其他回答
我在AWS CodeCommit上也遇到了同样的问题。所有人都在一台笔记本电脑上工作,但另一台却没有。解决方案是在AWS配置部分的.ssh/config中删除'PreferredAuthentications publickey'行。
这发生在我身上。出于某种原因,我的出身在我没有意识到的情况下被搞砸了:
检查您的设置是否仍然正确
git remote -v
url需要像ssh://git@github.com/YourDirectory/YourProject.git; 如果没有看到git@github.com,请使用
git remote set-url origin git://github.com/YourDirectory/YourProject.git
纠正错误。或者你可以使用github应用程序在特定存储库的设置面板中检查和设置主远程存储库url。
GitHub无法验证你的身份。所以,要么你没有安装SSH密钥,因为你还没有在你的机器上设置一个,要么你的密钥没有与你的GitHub帐户相关联。
您还可以使用HTTPS URL而不是SSH/git URL来避免必须处理SSH密钥。这是GitHub推荐的方法。
此外,GitHub有一个专门针对该错误消息的帮助页面,并更详细地解释了您可以检查的所有内容。
博士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。
这种情况会发生在创建存储库后遵循GitHub指示时。Git将指示您使用以下内容添加遥控器。
Git远程添加源git@github.com:<用户>/<项目>.git
将<>中的内容替换为与您的帐户相关的值。
解决方案是删除.git后缀。添加遥控器的操作如下:
Git远程添加origin git@github.com:<用户>/<项目>