有人看到这个错误并知道该怎么做吗?
我正在使用终端,我在根,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.
当前回答
我在AWS CodeCommit上也遇到了同样的问题。所有人都在一台笔记本电脑上工作,但另一台却没有。解决方案是在AWS配置部分的.ssh/config中删除'PreferredAuthentications publickey'行。
其他回答
假设您正在通过SSH连接GitHub,您可以运行以下命令来确认这一点。
$git config --get remote.origin.url
如果您得到的结果格式如下:git@github.com:xxx/xxx.github.com.git,那么您应该执行以下操作。
生成SSH密钥(或使用现有密钥)。如果你有一个,你只需要将你的密钥添加到ssh-agent(步骤2)和你的GitHub帐户(步骤3)。
下面是那些没有SSH密钥的人。
步骤1生成rsa公私钥对。
$ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
系统会要求您确认保存SSH密钥的位置以及您想使用的密码短语。
步骤2在ssh-agent中添加密钥
确保ssh-agent已启用 $eval "$(ssh-agent -s)" 将SSH密钥添加到SSH -agent: ssh-add ~ / . ssh / id_rsa美元
步骤3在帐号中添加SSH密钥
安装xclip
$xclip -sel clip < ~/.ssh/id_rsa.pub
然后将复制的密钥添加到GitHub
进入“设置”->SSH密钥(个人设置侧栏)->添加SSH密钥->填写表单(密钥在剪贴板上,只需使用ctrl+v)->添加密钥
通过以上步骤,您应该可以解决权限问题。
参考链接: 生成SSH密钥。
如果您正在使用GitHub for Mac UI,请检查首选项以确保您已登录。
你需要生成一个SSH密钥(如果你没有的话),并将公钥与你的Github帐户相关联。参见Github自己的文档。
对我来说,我试过这个
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帐户
我希望它能帮助到其他人:)
这可能是由于您的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密钥上