Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top


  1. I have a Chef server installed.
  2. I have registered a node to this server, and I can see the node in the webUI (This is an existing node, NOT bootstrapped using knife bootstrap
  3. When I execute the command

    $ knife ssh "role:test" "sudo chef-client"
    WARNING: Failed to connect to node[ip-X-X-X-X.ec2.internal] -- Net::SSH::AuthenticationFailed: ubuntu@ip-X-X-X-X.ec2.internal

Is there something I have missed? e.g. copy the SSH keys?

share|improve this question
up vote 2 down vote accepted

This problem is usually caused by not having the right private key PEM file added to your local ssh agent. Doing something like:

$ ssh-add pk-XXXX

Where the argument is the private part of the key pair used to create the EC2 instance.

share|improve this answer

I see from your error message that it's trying to log in as the "ubuntu" user. Make sure this user is getting the correct key put in it's ~/.ssh/authorized_keys file. I'm not sure about Ubuntu instances but I know the Amazon Linux systems only have the key copied to the ec2-user account. You would have to script or manually copy the key for that user.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.