Ssh-key issues: Permission denied (publickey,password)

Persistant ssh error of Permission denied (publickey,password)

Summary
I have two accounts (account A and account B) with gitlab.pavlovia.org. The gitlab organization I’m working with requires SSH key authentication. I set up authentication for account A without issues. I then went to set up authentication for account B and persistently encountered the error “Permission denied (publickey,password).” When I cleared my .ssh file, and removed all the connections from ssh-add then re-added account A, I encountered the same error. I’ve tried clearing all the files (including known_hosts) and starting over multiple times, but the error is persistant.

Here’s a description of the initial steps I followed:

To outline things exactly, I first created the key using the command:

ssh-keygen -o -t rsa -b 4096 -C "EMAIL"

I named the key id_rsa_gitlab_pavlovia, and set the password to just enter.

I then changed permissions using:

chmod 600 id_rsa_gitlab_pavlovia*

I copied the key using:

pbcopy < id_rsa_gitlab_pavlovia.pub

and used that to register in my gitlab account.

I then started the ssh agent locally with

eval "$(ssh-agent -s)"

and added my key using,

ssh-add ~/.ssh/id_rsa_gitlab_pavlovia

When I used the command:

ssh-add -l

It showed an active key.

I also set up a config file,

# Pavlovia GitLab instance
Host gitlab.pavlovia.org
  Preferredauthentications publickey
  IdentityFile ~/.ssh/id_rsa_gitlab_pavlovia

Then, when I try running:

ssh -v -T git@gitlab.pavlovia.org

I persistently get the following error. Keep in mind, I’ve tried clearing all the keys and associated files and starting over multiple times, but continue to get the error.

debug1: Local version string SSH-2.0-OpenSSH_9.0
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.9p1 Ubuntu-3ubuntu0.6
debug1: compat_banner: match: OpenSSH_8.9p1 Ubuntu-3ubuntu0.6 pat OpenSSH* compat 0x04000000
debug1: Authenticating to gitlab.pavlovia.org:22 as 'git'
debug1: load_hostkeys: fopen /Users/warrenpettine/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: sntrup761x25519-sha512@openssh.com
debug1: kex: host key algorithm: ssh-ed25519
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: SSH2_MSG_KEX_ECDH_REPLY received
debug1: Server host key: ssh-ed25519 SHA256:t7zVlMWCXcNuuJUNHBUhi1G0hMFoRBR7d7COYlbTBfE
debug1: load_hostkeys: fopen /Users/warrenpettine/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: Host 'gitlab.pavlovia.org' is known and matches the ED25519 host key.
debug1: Found key in /Users/warrenpettine/.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: get_agent_identities: bound agent to hostkey
debug1: get_agent_identities: agent returned 1 keys
debug1: Will attempt key: /Users/warrenpettine/.ssh/id_rsa_gitlab_pavlovia_um RSA SHA256:Lm8V+7wUbTDazm7k7RClvnZYQkUA+kmGwG7Evh9kha4 explicit agent
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,sk-ssh-ed25519@openssh.com,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ecdsa-sha2-nistp256@openssh.com,webauthn-sk-ecdsa-sha2-nistp256@openssh.com>
debug1: kex_input_ext_info: publickey-hostbound@openssh.com=<0>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /Users/warrenpettine/.ssh/id_rsa_gitlab_pavlovia_um RSA SHA256:Lm8V+7wUbTDazm7k7RClvnZYQkUA+kmGwG7Evh9kha4 explicit agent
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
git@gitlab.pavlovia.org: Permission denied (publickey).

Furthermore, in my accounts gitlab console it says the key has never been used.