Permission denied (publickey) I still get an error

I keep getting this error in git. I have read and tried very many things but none seems to work (changed 700 or 600 permissions, I selected only the rsa key with the -i option, I did ssh-add ~/.ssh/id_rsa, …)

Can anyone help?

  • Git commit ERROR: Repository invalid
  • Is it possible to have a local file that's different from its remote counterpart on Github?
  • Git: What is the index
  • Git - get list of files changed in a branch that was merged back
  • How do I force fetching of tags if I have the --no-tags option set
  • Does using Git make sense for small internal teams?
  • thanks

    ssh -vT git@github.com
    OpenSSH_5.1p1, OpenSSL 0.9.8h 28 May 2008
    debug1: Reading configuration data /home/myusername/.ssh/config
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: Applying options for *
    debug1: Connecting to github.com [207.97.227.239] port 22.
    debug1: Connection established.
    debug1: identity file /home/myusername/.ssh/identity type -1
    debug1: identity file /home/myusername/.ssh/id_rsa type 1
    debug1: identity file /home/myusername/.ssh/id_dsa type -1
    debug1: Remote protocol version 2.0, remote software version OpenSSH_5.5p1 Debian-    6+squeeze1+github8
    debug1: match: OpenSSH_5.5p1 Debian-6+squeeze1+github8 pat OpenSSH*
    debug1: Enabling compatibility mode for protocol 2.0
    debug1: Local version string SSH-2.0-OpenSSH_5.1
    debug1: SSH2_MSG_KEXINIT sent
    debug1: SSH2_MSG_KEXINIT received
    debug1: kex: server->client aes128-cbc hmac-md5 none
    debug1: kex: client->server aes128-cbc hmac-md5 none
    debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
    debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
    debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
    debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
    debug1: Host 'github.com' is known and matches the RSA host key.
    debug1: Found key in /home/myusername/.ssh/known_hosts:8
    debug1: ssh_rsa_verify: signature correct
    debug1: SSH2_MSG_NEWKEYS sent
    debug1: expecting SSH2_MSG_NEWKEYS
    debug1: SSH2_MSG_NEWKEYS received
    debug1: SSH2_MSG_SERVICE_REQUEST sent
    debug1: SSH2_MSG_SERVICE_ACCEPT received
    debug1: Authentications that can continue: publickey
    debug1: Next authentication method: publickey
    debug1: Offering public key: /home/myusername/.ssh/id_rsa
    debug1: Authentications that can continue: publickey
    debug1: Trying private key: /home/myusername/.ssh/identity
    debug1: Trying private key: /home/myusername/.ssh/id_dsa
    debug1: No more authentication methods to try.
    

    if I do:

    ssh-add -l
    

    I get

    2048 60:2f:84:01:91:db:f7:83:fa:e0:a2:9a:55:49:85:ad /home/myusername/.ssh/id_rsa (RSA)
    

    I added in the .bashrc

    !/bin/bash
    eval `ssh-agent -s`
    ssh-add
    

    and now I have a .ssh/config file like this:

    #  personal account
    #
    Host personal.repositoryhosting.com
    Hostname personal.repositoryhosting.com
    IdentitiesOnly yes
    IdentityFile ~/.ssh/id_rsa
    
    #
    

  • how to set up ssh key in windows 7 machine
  • How does git compare files?
  • After a git pull there a lot of unrelated modifications in the staging area
  • Best (and safest) way to merge a git branch into master
  • How to create git branch from current files without changing master?
  • add ssh keys in Docker
  • 2 Solutions collect form web for “Permission denied (publickey) I still get an error”

    Usually the id_dsa (or id_rsa) are your private keys, and the corresponding file with ‘.pub’ on the end is your public key.

    What is your ~/.ssh/personal_key and how does it relate to your public/private key?
    – and does your ssh agent know about it?

    removed my old .ssh folder – back it up. might not be ideal depending on the number of ssh keys you have and what they are for.

    craicerjack@ubuntu:~$ sudo rm -rf .ssh
    

    cd back into your project directory

    git init
    
    touch README
    
    git push -u origin master
    
    The authenticity of host 'your_host' can't be established.
    ECDSA key fingerprint is b2:9f:1a:8c:13:9b:1f:a2:64:a9:5c:db:61:a5:04:bb.
    Are you sure you want to continue connecting (yes/no)? 
    Warning: Permanently added 'your_host' (ECDSA) to the list of known hosts.
    Branch master set up to track remote branch master from origin.
    Everything up-to-date
    

    This creates a new .ssh dir with known_hosts file.
    cd into .ssh

    craicerjack@ubuntu:~$ cd ~/.ssh
    

    Next create a new key

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

    via https://gitlab.deri.ie/help/ssh on gitlab
    or https://help.github.com/articles/generating-ssh-keys on github.

    Generating public/private rsa key pair.
    Enter file in which to save the key (/home/carlos/.ssh/id_rsa): (you can leave this blank if you are in your .ssh dir, otherwise choose where to save the key)
    Enter passphrase (empty for no passphrase): (leave this blank if you wish)
    Enter same passphrase again: (leave this blankif you wish)
    Your identification has been saved in /home/carlos/.ssh/id_rsa.
    Your public key has been saved in /home/carlos/.ssh/id_rsa.pub.
    

    use this to dump the key to your console and then copy it:

    cat ~/.ssh/id_rsa.pub
    

    go to your account in gitlab or github.
    gitlab – https://gitlab.deri.ie/profile/keys
    github – https://github.com/settings/ssh

    and click on add ssh key

    paste your new key in and you should be good to go. This worked for me anyway.

    Git Baby is a git and github fan, let's start git clone.