git Permission denied (publickey,gssapi-keyex,gssapi-with-mic)

后端 未结 2 1379
情深已故
情深已故 2020-12-11 09:55

I have a public/private rsa key pair. I can connect to remote server with ssh, but when I do git pull origin master I get this error:

Per

2条回答
  •  余生分开走
    2020-12-11 10:10

    sudo chmod -R 777 folder but without any success.

    That would never work, as any folder with writing right would make ssh fail immediately.

    You need to make sure that:

    • you have generate the ssh key pair properly:

      ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
      

    (I recommend not setting a passphrase at first, at least for testing)

    • the right associate with your ~/.ssh/id_rsa(.pub) are correct.
      At least:

      chmod 700 /home//.ssh
      chmod 600 /home//.ssh/authorized_keys
      
    • the ssh url is correct.
      For instance, GitHub would use git@github.com:user/repo

    • your ssh key is registered to your account (Example for GitHub)

提交回复
热议问题