Encountering the "No supported authentication methods available server sent public key" error when connecting to an EC2 instance via SSH is a common frustration. This error can prevent you from accessing your remote server. In this article, we'll explore the causes of this error and provide solutions to resolve it.
- Incorrect Login Credentials: Entering an incorrect username or password during the SSH connection attempt will result in failed authentication.
- Incorrect SSH Key: If you're using SSH keys for authentication, an invalid or incorrect key can prevent successful connection to the remote server.
- Server Configuration: If the remote server is not properly configured to allow the chosen authentication method, you won't be able to authenticate.
- ec2-user for Amazon Linux AMIs
- centos for CentOS AMIs
- debian or root for Debian AMIs
- ec2-user or fedora for Fedora AMIs
- ec2-user or root for RHEL AMIs, SUSE AMIs, and others.