After running sudo apt upgrade on my Ubuntu 24.04 system, I started encountering an issue when trying to use Git via SSH. Every time I try to fetch from my Bitbucket repository, I receive the following error:
input_userauth_error: bad message during authentication: type 7fatal: Could not read from remote repository.I can connect without problems from another computer, even using the same private key.
Here's what I've tried so far:
- Verified that my SSH keys are correctly added to the SSH agent with ssh-add -l, and my
id_ed25519key is listed. - Tested the connection to Bitbucket with
ssh -T git@bitbucket.org, but the same error occurs. - Checked the permissions on my SSH keys (
chmod 600for private keys andchmod 700for the .ssh folder). - Added the following configuration in my
~/.ssh/configfile:
Host bitbucket.org HostName bitbucket.org User git IdentityFile ~/.ssh/id_ed25519 IdentitiesOnly yes- Tried removing all identities with
ssh-add -Dand re-adding just myid_ed25519key, but no success. - I’ve also tested with
ssh -vvvto get more detailed output, and the error still occurs when the server tries to authenticate.
debug3: ssh_get_authentication_socket_path: path '/tmp/ssh-6y3Ocd37580f/agent.127540'debug1: get_agent_identities: bound agent to hostkeydebug1: get_agent_identities: agent returned 1 keysdebug1: Will attempt key: /home/mike/.ssh/id_ed25519 ED25519 SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx explicit agentdebug2: pubkey_prepare: donedebug1: Offering public key: /home/mike/.ssh/id_ed25519 ED25519 SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx explicit agentdebug3: send packet: type 50debug2: we sent a publickey packet, wait for replydebug3: receive packet: type 7input_userauth_error: bad message during authentication: type 7I suspect this issue may be related to the latest package updates I installed via sudo apt upgrade because everything was working fine before the upgrade. I'm running OpenSSH_9.6p1 and OpenSSL 3.0.13. Some have suggested adding AllowPKCS12keystoreAutoOpen=no to the SSH config, but it seems my version of OpenSSH doesn't recognize this option.
Has anyone else encountered this issue after running apt upgrade on Ubuntu 24.04? Any guidance on how to resolve this SSH authentication problem would be greatly appreciated.
Thanks in advance!