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

I'm trying to add a deploy user to a EC2 instance to work with capistrano. I've been able to add passwordless entry for user ubuntu, but it's not working with "deploy". I'm setting up this user as follows:

adduser --system --home /home/deploy --shell /bin/bash --ingroup nogroup deploy
chmod u+w /etc/sudoers
echo "deploy  ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
chmod u-w /etc/sudoers

I then copy the authorized keys

cp /root/.ssh/authorized_keys /home/deploy/.ssh/authorized_keys

and restart ssh

/etc/init.d/ssh restart

But then when I try to sign in from my local machine like:

 ssh -v -i ec2-keypair 

I still get a request for a password. Any ideas?

share|improve this question
Output of ssh -vv. Show the permissions of .ssh, and the authorized_keys. – Zoredache Sep 15 '11 at 22:36
Is "ec2-keypair" the public key or the private key? – EEAA Sep 15 '11 at 23:09

You would probably be safer generating a new keypair for your deploy user rather than reusing the root one.

As you don't mention it, the first thing to check is the ownership & permissions of the authorized_keys file, if it is not owned by the deploy user or has w for group/other then ssh will fall back on Password authentication.

You can disable PasswordAuthentication in your /etc/ssh/sshd_config


You can try this manually with

ssh -v -o PasswordAuthentication=no -i ec2-keypair 

before making changes to your configuration.

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.