Troubleshooting passwordless login

If ssh-copy-id or the Mac OS X command does not work on your Linux machine

  1. Follow step one in the previous section to create the keypair on your home computer.
  2. If ssh-copy-id doesn’t work for you, then manually upload your public key to your DreamHost server. On your home computer run this command under your username where you created your key pair:
    [server]$ scp ~/.ssh/

    This copies the file on your home computer to your DreamHost SHELL user.

  3. Log into your DreamHost server through your SHELL user.
  4. Once logged into your DreamHost server, you’ll need to append the public key you just uploaded to your authorized_keys file. To do this, first make sure you’re in your users directory:
    [server]$ pwd
  5. In that directory, create the /.ssh folder:
    [server]$ mkdir .ssh
  6. Run the following command to create a new file named 'authorized_keys' in the new /.ssh folder. This will also copy your file into this new authorized_keys file:
    [server]$ cat >> .ssh/authorized_keys
  7. Remove the original file in your SHELL user’s directory:
    [server]$ rm
  8. Make sure the permissions are correctly set on the /.ssh folder and /.ssh/authorized_keys file. Run these three commands under your SHELL user:
    [server]$ chmod 700 ~/.ssh
    [server]$ chmod 600 ~/.ssh/authorized_keys

If everything is configured properly, you should now be able to access your DreamHost account through SSH without a password. Run this command on your home computer where you just created the original keypair.

[server]$ ssh

For more information, see the man pages for ssh, ssh-keygen, ssh-copy-id, and sshd. “Getting started with SSH” is a step-by-step tutorial which you may find helpful.

Unable to log in from Linux after the public key has been copied to your DreamHost server

You should be able to log in immediately after the key has been copied to your server. However it's possible you may see this error when logging in:

Error: Agent admitted failure to sign

To fix this, use ssh-agent to store your password in your current session.

  1. Start ssh-agent by running the following command. Make sure you use the backquote ` character and not a single quote – this backquote character is usually on the top left of your keyboard on the tilde ~ key:
    [server]$ eval `ssh-agent`
    • ssh-agent is a program that handles passwords for private keys.
  2. Run the following to add your private key to ssh-agent:
    [server]$ ssh-add
  3. Enter your private key password (if you created one).
  4. Enter the following into your .bash_profile or .bashrc file to kill the ssh-agent when logging out.
    [server]$ kill $SSH_AGENT_PID

When you now log into your server via SSH, you are not prompted for a password.

Unable to log in from Mac OSX after the public key has been copied to your DreamHost server

If you are unable to log in automatically after uploading your public key, it may be because you are using custom keypair names; that is, you are using something other than id_rsa/ This is common when one maintains multiple keypairs.

Enter the following to run ssh in verbose mode:

[server]$ ssh -v

Check the output for your public key name. If the output indicates that ssh is looking for 'id_rsa' and you are using a custom key name, then this likely explains why you still cannot log in without entering your password. To remedy this, enter the following:

[server]$ ssh-add ~/.ssh/customkey_rsa

See also

Did this article answer your questions?

Article last updated .