I just generated my first SSH pair on my windows machine but I cannot seem to configure gitlab to be working correctly. I did:
$ssh-keygen -t rsa -b 4096 -C "email@example.com"
and generated public/private rsa key pair
Your identification has been saved in /c/Users/name/.ssh/id_rsa.
Your public key has been saved in /c/Users/name/.ssh/id_rsa.pub.
Then I copied the public key by doing
cat ~/.ssh/id_rsa.pub | clip
I pasted this on the SSH keys part in the gitlab site under Settings and saved it, I can now see my ssh key there
Yet, when I do
ssh -T firstname.lastname@example.org, I get
The authenticity of host ‘gitlab.com (188.8.131.52)’ can’t be established.
ECDSA key fingerprint is SHA256:HbW3g8zUjNSksFbqTiUWPWg2Bq1x8xdGUrliXFzSnUw.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added ‘gitlab.com,184.108.40.206’ (ECDSA) to the list of known hosts.
email@example.com: Permission denied (publickey).
$ ssh -vT firstname.lastname@example.org OpenSSH_8.0p1, OpenSSL 1.1.1c 28 May 2019 debug1: Reading configuration data /etc/ssh/ssh_config debug1: Connecting to gitlab.com [220.127.116.11] port 22. debug1: Connection established. debug1: identity file /c/Users/name/.ssh/id_rsa type 0 debug1: identity file /c/Users/name/.ssh/id_rsa-cert type -1 debug1: identity file /c/Users/name/.ssh/id_dsa type -1 debug1: identity file /c/Users/name/.ssh/id_dsa-cert type -1 debug1: identity file /c/Users/name/.ssh/id_ecdsa type -1 debug1: identity file /c/Users/name/.ssh/id_ecdsa-cert type -1 debug1: identity file /c/Users/name/.ssh/id_ed25519 type -1 debug1: identity file /c/Users/name/.ssh/id_ed25519-cert type -1 debug1: identity file /c/Users/name/.ssh/id_xmss type -1 debug1: identity file /c/Users/name/.ssh/id_xmss-cert type -1 debug1: Local version string SSH-2.0-OpenSSH_8.0 debug1: Remote protocol version 2.0, remote software version OpenSSH_7.2p2 Ubuntu-4ubuntu2.8 debug1: match: OpenSSH_7.2p2 Ubuntu-4ubuntu2.8 pat OpenSSH_7.0*,OpenSSH_7.1*,OpenSSH_7.2*,OpenSSH_7.3*,OpenSSH_7.4*,OpenSSH_7.5*,OpenSSH_7.6*,OpenSSH_7.7* compat 0x04000002 debug1: Authenticating to gitlab.com:22 as 'git' debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: algorithm: email@example.com debug1: kex: host key algorithm: ecdsa-sha2-nistp256 debug1: kex: server->client cipher: firstname.lastname@example.org MAC: <implicit> compression: none debug1: kex: client->server cipher: email@example.com MAC: <implicit> compression: none debug1: expecting SSH2_MSG_KEX_ECDH_REPLY debug1: Server host key: ecdsa-sha2-nistp256 SHA256:HbW3g8zUjNSksFbqTiUWPWg2Bq1x8xdGUrliXFzSnUw debug1: Host 'gitlab.com' is known and matches the ECDSA host key. debug1: Found key in /c/Users/name/.ssh/known_hosts:1 debug1: rekey out after 134217728 blocks debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: rekey in after 134217728 blocks debug1: Will attempt key: /c/Users/name/.ssh/id_rsa RSA SHA256:obo9n4XbjTLVVWY7EWCqWT/Kcryl55dbRPYThuGZxHE debug1: Will attempt key: /c/Users/name/.ssh/id_dsa debug1: Will attempt key: /c/Users/name/.ssh/id_ecdsa debug1: Will attempt key: /c/Users/name/.ssh/id_ed25519 debug1: Will attempt key: /c/Users/name/.ssh/id_xmss debug1: SSH2_MSG_EXT_INFO received debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-256,rsa-sha2-512> debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey debug1: Next authentication method: publickey debug1: Offering public key: /c/Users/name/.ssh/id_rsa RSA SHA256:obo9n4XbjTLVVWY7EWCqWT/Kcryl55dbRPYThuGZxHE debug1: Authentications that can continue: publickey debug1: Trying private key: /c/Users/name/.ssh/id_dsa debug1: Trying private key: /c/Users/name/.ssh/id_ecdsa debug1: Trying private key: /c/Users/name/.ssh/id_ed25519 debug1: Trying private key: /c/Users/name/.ssh/id_xmss debug1: No more authentication methods to try. firstname.lastname@example.org: Permission denied (publickey).
How do I fix this?