Ubuntu 22.04 EC2 key pair not excepted without sshd_config edit
Hello,
Not sure if this is a bug as replicating the same steps with an ubuntu 20.04 EC2 image does not fail.
Whenever I launch an Ubuntu 22.04 EC2 image and try and connect via SSH I get the following error (This is with the .PEM file directly from AWS console): "No supported authentication methods available (server sent: publickey)".
To fix this I have to add the following line to the sshd_config to except ssh-rsa keys: "PubkeyAcceptedKeyTypes=+ssh-rsa"
Is this expected behaviour?
Thanks,
Hello,
In case you run into this issue too, please see the below comment that fixed the issue for me:
With the 22.04 Jammy Jellyfish release, an older, vulnerable standard for SSH communication has been deprecated. That is an improvement in security, but it has consequences that can mysteriously cause grief to those who are not forewarned.
PuTTY 0.74 or earlier won't connect via SSH. (Upgrade to PuTTY 0.76 or later.) The current latest WinSCP (5.19.6) or earlier also will not connect via SSH, but version 5.20 (currently in beta) will.
Thanks, Alex
Hi there, from the case notes I understand you want to launch an Ubuntu 22.04 EC2 image and getting an error when trying to connect via ssh.
You will need to first verify if you are connecting with the appropriate user name for your AMI.An appropriate user name for Ubuntu AMI is UBUNTU.
Secondly you should also verify that your private key(.pem) file has been correctly converted to the format recognised by PuTTY(.ppk).
Lastly check the document provided and confirm if the requirements are followed.
I have provided you with additional documentation under the reference section.
If you have any further questions , feel free to reply back.
Reference
[1]Connecting to your Linux instance from Windows using PuTTY https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/putty.html
Relevant questions
Cron jobs on Ubuntu EC2 Instance
asked 5 months agoUbuntu 22.04 EC2 key pair not excepted without sshd_config edit
Accepted Answerasked a month agoKey pair is not valid
asked a month agoUbuntu 18.04 AMI with "ubuntu-desktop" pkg fails to connect (networking)
asked 4 years agoscp command difference for Ubuntu EC2 in a VPC
asked 3 months agoEC2 Image Builder: Role does not exist or does not have sufficient permissions
asked 2 months agoLaunched EC2 instance UNREACHABLE for Ubuntu 20.04 AMI with python 3.9 upgrade
asked 6 months agoEC2 instance - Server refused our key
asked 5 months agoCloudFormation template publishing without creating and publish an AMI
asked 3 years agoHow to install usbip vhci_hcd drivers on an AWS EC2 Ubuntu Kernel Version
asked 2 years ago