Short problem description: I had created two new AWS EC2 server instances on Redhat Linux and Ubuntu operating system. I was trying to login to it through SSH via Putty but was getting errors(detailed errors further in question). This is just a short description.
Detailed problem description: I generated a new .pem file after creating a free tier Amazon EC2(Elastic Compute Cloud) server of Ubuntu 20 O.S version. Then I have used PuttyGen
software in my Windows-10 O.S p.c. While trying to login through putty it was giving me an error as shown in the following error description, due to this I was not able to login to aws machines, I have further investigated the issue and all details of troubleshooting steps are mentioned in detailed manner in this self answered question(other suggestions/solutions are welcome).
Error's description:
"Server refused our key"
On terminal AND "NO supported authentication method available(server sent:public ke;gssapi-with-mic)"
Initial troubleshooting:
Obviously nothing of above worked; enough talks so coming now to actual solution now :)
ACTUAL FIX with complete steps:
ssh
, hence I tried SSH with powershell as follows.PS E:\test> ssh -i "aws_key_generator.pem" ubuntu@singh_server_test.compute.amazonaws.com
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @
WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions for 'aws_key_generator.pem' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "aws_key_generator.pem": bad permission
"Right click on .pem file"-->"Properties"-->"Security"-->"Advance"
and disabled “Inheritance” from there.PuttyGen
to "authorized_keys" and saved it.I have fixed issue with this work around fix and thought to share with all here; other solutions are welcomed too, cheers and Happy learning.
It appears that you are logging into an Ubuntu server.
For that, the username should be ubuntu
, not ec2-user
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With