security - Connecting AWS EC2 instance asks for password although PEM file is provided -
I have just made an EC2 example on AWS before, I added my key, downloaded the private key.
I am now trying to log on to the newly created instance (using the correct host name, of course, which I have changed here for security). I've added a V switch to get debug output:
ssb ec2-user@myvirtual.host.compute-1.amazonaws.com -i ~ / EC2key.pem -v Although I provide a key file, I am asked for a password. This is a fraction of the debug output that can show what is going wrong:
debug1: host 'myVirtualHost.compute-1.amazonaws.com' matches ECDSA host key and Matches. Debug 1: found in Key / Memory / SSI / Known_Hosts: Debug 1: SSH_SADSA_Verification: Signature Correct Debug 1: SSH2_MSG_NEWKEYS Sent Debug 1: Expected SSH2_MSG_NEWKEYS Debug 1: SSH2_MSG_NEWKEYS Received Debug 1: Not allowed by server debug 1: SSH2_MSG_SERVICE_REQUEST Debug 1 Sent: SSH2_MSG_SERVICE_ACCEPT Received Debug 1: Authentication that can be continued: Publishing, Password Debug 1: Next Authentication Method: Publisher Debug 1: Trying Private Key: /home/myuser/EC2key.pe M debug1: PEM completed the private key: Type RSA debug 1: authentication that can continue: publication, password debug 1: next authentication method: password ec2-user@myVirtualHost.compute-1.amazonaws.com password: [Asks for password] Why the "PEM Private key has been completed: Type RSA" Conclusion "Authentication that can be continued: publication, password"?
I am both happy and courteous to report that the problem was that I was a non-existing user. The tutorial I had suggested to use the following name was not related to the user name in the respective AMI. This was suggested by Amazon Support when they double-checked their tutorials.
I'm not sure how to find the default login name from EC2 Management Console. At least one quick search did not match any match for the correct username in the properties.
Now I can log the important file through the I-I option, because I have added the key to my keyring with the Ssh-add command.
Comments
Post a Comment