Sometimes with all of the rush and trying to keep track of a 1000 moving parts you might get stumped by a fairly simple issue. Here are a few things to check if you get hung up with an “Authentication failed for user” error when running a “Knife ec2 server create” command.
Waiting for sshd access to become availabledone Connecting to 220.127.116.11 Failed to authenticate ec2-user - trying password auth Enter your password: ERROR: Net::SSH::AuthenticationFailed: Authentication failed for user firstname.lastname@example.org@18.104.22.168
Do you have your .pem file downloaded and installed with the correct permissions on your workstation you are running the command from?
It should be in the EC2-USER’s .ssh dir -> /home/ec2-user/.ssh
Make sure its chmodded 400
Make sure you have the knife.rb file set correctly to reference the .pem file for you…otherwise you will have a lot of typing for your command.
knife[:identity_file] = "/home/ec2-user/.ssh/aws-seth.pem"
Make sure you are using the correct user. Unless you have specifically changed something in your configurations by default you will be connecting as the “ec2-user”. So make sure thats what is trying to connect in your error output.
Hopefully these tips will help you narrow down the issue. You have to think about whats really happening and from where with Chef some sometimes these simple issues can really drive you nuts.