git push origin master 给出错误权限被拒绝(github)

发布于 2024-12-03 09:08:36 字数 1245 浏览 1 评论 0原文

错误:kevinzen 的 durrantm/linker.git 权限被拒绝。 fatal:远端意外挂断

我尝试了很多方法来更改/设置我的身份并摆脱“kevinzen”

更新 - 最终解决方案是我添加了我的公钥......但是。 ..我错过了一些字符,所以它是无效的。在 github 上粘贴正确的密钥修复了它

我有 ~/.ssh/ 和文件

  • config
  • id_dsa
  • id_dsa. pub
  • id_kb_rsa
  • id_kb_rsa.pub
  • id_rsa
  • id_rsa.pub
  • known_hosts

我已经完成了

git config --global user.name
git config --global user.email
git remote add origin [email protected]:durrantm/linker.git

,我已将本机的本地 ssh 密钥和我的信息(不是 kevinz)添加到 github ssh 密钥。

我也尝试过: ssh [电子邮件受保护]。 主机“github.com”的真实性。 (207.97.227.239)' 无法建立。 RSA 密钥指纹为 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48。 您确定要继续连接吗(是/否)?是的 警告:永久添加“github.com”。 (RSA) 到已知主机列表。 PTY 分配请求在通道 0 上失败

不确定 PTY 错误。还是卡住了。

ERROR: Permission to durrantm/linker.git denied to kevinzen.
fatal: The remote end hung up unexpectedly

I've tried a lot of things to change/set my identity and get rid of that 'kevinzen'

Update - final resolution was that I had added my public key... but... I had missed a few characters so it was invalid. Pasting in the correct key on github fixed it

I have ~/.ssh/ with files

  • config
  • id_dsa
  • id_dsa.pub
  • id_kb_rsa
  • id_kb_rsa.pub
  • id_rsa
  • id_rsa.pub
  • known_hosts

I have done

git config --global user.name
git config --global user.email
git remote add origin [email protected]:durrantm/linker.git

I have added my local ssh key with my info (not kevinz) for this machine to github ssh keys.

I also tried:
ssh [email protected].
The authenticity of host 'github.com. (207.97.227.239)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com.' (RSA) to the list of known hosts.
PTY allocation request failed on channel 0

wasn't sure about the PTY error. Still stuck.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

全部不再 2024-12-10 09:08:36

您是否在 GitHub 上安装了密钥?您读过那里的帮助部分吗?

您可以列出 <一个href="https://github.com/settings/keys" rel="nofollow noreferrer">您自己保存在 GitHub 上的密钥:

curl https://github.com/<username>.keys

您是否检查过其中一个密钥与您的密钥之一匹配钥匙?比较:

cat ~/.ssh/id_*.pub

Did you install your key at GitHub? Have you read help section there?

You can list your own keys as saved at GitHub by:

curl https://github.com/<username>.keys

Have you checked that one of the keys is a match to one of your keys? Compare:

cat ~/.ssh/id_*.pub
黎歌 2024-12-10 09:08:36

我有同样的问题,我的解决方案很简单。我已经有了我的密钥设置和一切,并继续尝试运行:

git config --global user.name IceMupppet

查看我的 ~/.ssh/ 之后,我注意到正在运行:

ssh-add -l

我看到只需使用正确的 git 帐户,我刚刚添加了正确的文件:

ssh-add ~/.ssh/id_IceMupppet_rsa

...然后git Push origin master 工作正常。我的 ssh 配置上有一个别名,可以为我的工作和个人使用不同的密钥,但由于某种原因仍然必须执行此步骤。

I had the same problem, my solution was simple. I already have my keys setup and everything and kept trying to run:

git config --global user.name IceMupppet

After looking through my ~/.ssh/ I noticed that running:

ssh-add -l

I saw that to simply use the right git account I just added the right file:

ssh-add ~/.ssh/id_IceMupppet_rsa

... then a git push origin master worked fine. I have an alias on my ssh config to use different keys for my work and personal, but still had to do this step for some reason.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文