The Problem:
Today, I launched a new AWS instance with Ubuntu 22.04. The default key provided by AWS is working fine with SSH. But when I attached my personal ssh key to the server and tried to access with FileZilla over SFTP, I got the following error in auth.log.
May 10 11:52:58 localhost sshd[57650]: Disconnected from authenticating user ubuntu 203.190.146.202 port 46565 [preauth]
May 10 11:52:59 localhost sshd[57652]: userauth_pubkey: key type ssh-rsa not in PubkeyAcceptedAlgorithms [preauth]
May 10 11:53:00 localhost sshd[57652]: message repeated 3 times: [ userauth_pubkey: key type ssh-rsa not in PubkeyAcceptedAlgorithms [preauth]]
May 10 11:53:00 localhost sshd[57652]: error: Received disconnect from 203.190.146.202 port 50045:14: No supported authentication methods available [preauth]
May 10 11:52:59 localhost sshd[57652]: userauth_pubkey: key type ssh-rsa not in PubkeyAcceptedAlgorithms [preauth]
May 10 11:53:00 localhost sshd[57652]: message repeated 3 times: [ userauth_pubkey: key type ssh-rsa not in PubkeyAcceptedAlgorithms [preauth]]
May 10 11:53:00 localhost sshd[57652]: error: Received disconnect from 203.190.146.202 port 50045:14: No supported authentication methods available [preauth]
The Solution:
First, I make confirm that key-based authentication is working as I was able to log in with the ssh key provided by the AWS console. After that, I created a new key with type ecdsa.
Advertisement
Open a terminal and generate a new key-pair:
ssh-keygen -t ecdsa
Once the key is generated, add the public key to remote servers ~/.ssh/authorized_key file.
Now, I can successfully connect to the remote server with FileZilla over SFTP.
2 Comments
This worked for me. I uncommented/added the following lines on /etc/ssh/sshd_config
PubkeyAuthentication yes
PubkeyAcceptedKeyTypes=+ssh-rsa
I had to work with the existing PEM keys.