• Recent blogs

    Issue: git@github: Permission denied (publickey)

    Issue: git@github: Permission denied (publickey)

    Issue: git@github.com: Permission denied (publickey)


    First check if your public key exists in your GitHub account: keys
    If not you must add it. In order to add it you must find it.

    cat ~/.ssh/id_rsa.pub

    Check that you can connect to git:

    ssh -vT git@github.com

    jenkins@d247c7beca6a:~$ cat /var/jenkins_home/.ssh/id_rsa.pub
    jenkins@d247c7beca6a:~$ ssh -T git@github.xxx.com
    Hi manast! You've successfully authenticated, but GitHub does not provide shell access.

    Another reason why you fail, may be a missing .config file in your ~/.ssh folder.

    If this is the case, just create it and paste the following into it:

    Host github.com
      User git
      Port 22
      Hostname github.xxx.com
      IdentityFile ~/.ssh/id_rsa
      TCPKeepAlive yes
      IdentitiesOnly yes

    Other reason could be : ssh will refuse to use any key file that is not readable only by the owner. make sure that the private and public keys are readable only by you (chmod 600 ~/.ssh/id_rsa.*)

    No comments