Putty Error No Supported Authentication Methods Available
How to Solve "Asunder: No supported authentication methods available (server sent: publickey)" with Ubuntu AWS EC2
This error happened to me and cost me a lot of time to solve it, and couldn't find a solution for information technology online, but afterwards some help from AWS back up, I managed to solve information technology, so I am sharing it hoping it will help others.
Background
I was trying to connect to Ubuntu AWS EC2 through PuTTy (I've tried other alternatives too) just when I do I go the mistake "Asunder: No supported authentication methods available (server sent: publickey)"
Troubleshooting
This error tin can occur nether the following circumstances:
- You're not connecting with the appropriate user name for your AMI when y'all negotiate an SSH session with an EC2 instance.
- You're using the wrong private key when you negotiate an SSH session with an EC2 case.
If you're connecting with an advisable user name, verify that yous are using the correct private key by following these steps:
Sign in to your AWS account and open the Amazon EC2 panel.
In the navigation pane, choose Instances.
Detect the EC2 instance you desire to connect to using SSH.
In the Cardinal Name column, verify the proper noun of the private key you're using to connect through SSH.
If you're using PuTTY:
Verify that the SSH private key matches the private key you see in the Primal Name column for your EC2 instance in the console. If your instance is based out of the Ubuntu OS, the default user name should be ubuntu.
Verify that your individual cardinal (.pem) file is converted to the format recognized by PuTTY (.ppk). For more information, see Converting your Private Key Using PuTTYgen.
- permission issue with directory contains the ssh cardinal (/home/ubuntu)
In my case, I take accidentally executed the command of sudo chmod -R 777 .
for the EC2 directory "/habitation/ubuntu", and then this resulted in denying the access to the EC2 and the wrong permission was similar
Meanwhile the right permission should exist
To solve this problem I had to create recovery instance in the aforementioned A-Z as impacted instance (in case of other wrong A-Z is selected you volition be not able to use + attach volume from impacted instance, which has to be attached + mounted on recovery example to piece of work on permissions).
- Create EC2 in the same Availability Zone of the impacted instance
- Stop the impacted instance.
- Detach the book of the impacted instance
- Adhere the volume to the new recovery instance
- Connect to recovery instance
- Mount the volume on the recovery instance as below
sudo mkdir /mountpoint
cd ../
lsblk # to know where the new volume is attached, in my instance "/dev/xvdf1"
sudo mountain /dev/xvdf1/mountpoint # mountain step
/dev/xvdf1 # this gave me permission denied
cd /mountpoint/var/log
ls
nano auth.log
This will evidence you the cause of fault which is "Hallmark refused: bad ownership or modes for file /home/ubuntu/.ssh/authorized_keys"
ls -50 /mountpoint/home/ubuntu/.ssh/authorized_keys
sudo chmod 600 /mountpoint/habitation/ubuntu/.ssh/authorized_keys
to make sure the permission has been updated execute
ls -50 /mountpoint/home/ubuntu/.ssh/authorized_keys
next stride is to
ls -ld /mountpoint//home/ubuntu/.ssh/
sudo chmod 700 /mountpoint/domicile/ubuntu/.ssh
ls -ld /mountpoint//habitation/ubuntu
sudo chmod 755 /mountpoint/home/ubuntu/
ls -ld /mountpoint//home/ubuntu
ls -ld /mountpoint//home/
Adjacent:
- Stop the recovery case
- Detach the volume of the impacted case from the recovery instane
- Attach the book to the impacted example
- Offset the impacted Instance
- Connect to the case through PuTTY
- Voila, now you can connect properly without errors.
References:
https://www.linode.com/docs/tools-reference/tools/modify-file-permissions-with-chmod/
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesConnecting.html https://aws.amazon.com/premiumsupport/knowledge-center/linux-credentials-error/
Putty Error No Supported Authentication Methods Available
Posted by: nathaliewonsession1954.blogspot.com
Comments
Post a Comment