CodexBloom - Programming Q&A Platform

SSH connection scenarios with 'No matching host key type' scenarios on Ubuntu 22.04 after upgrading OpenSSH

👀 Views: 85 đŸ’Ŧ Answers: 1 📅 Created: 2025-06-29
ssh ubuntu openssh bash

I'm collaborating on a project where I'm experiencing an scenario when trying to establish an SSH connection to my Ubuntu 22.04 server after I upgraded OpenSSH from version 8.4 to 8.6. The behavior I receive is `No matching host key type found. Their offer: [email protected]`. This seems to be related to the changes in default host key algorithms in the newer version of OpenSSH, which, from what I gathered, defaults to more secure key types that the client doesn't support. I tried manually specifying the host key algorithm using the `-oHostKeyAlgorithms=+ssh-rsa` option in my SSH command, but it still doesn't work. Here's how I'm attempting to connect: ```bash ssh -oHostKeyAlgorithms=+ssh-rsa user@server_ip ``` Furthermore, I confirmed that the server has the following algorithms available by checking the `sshd_config`: ```bash HostKeyAlgorithms ssh-rsa,ssh-ed25519 ``` In addition, I tried regenerating the SSH keys using the following command, hoping it would help: ```bash sudo ssh-keygen -t rsa -b 4096 -f /etc/ssh/ssh_host_rsa_key ``` After regenerating, I restarted the SSH service with: ```bash sudo systemctl restart sshd ``` Yet, I still face the same scenario when trying to connect. I also checked the client's `~/.ssh/config` file, but it doesn't specify any host key algorithms. I would appreciate any guidance on how to resolve this scenario or configure my setup to be able to connect without working with the host key type behavior. I'm working in a Debian environment. Am I missing something obvious?