Set up passwordless login in PuTTY


This article explains how to set up passwordless login with PuTTY. Make sure you have first configured PuTTY before proceeding with this article.

These instructions can also be used to create and assign SSH keys to an admin/root user on a Dedicated Server.

Creating a key pair

  1. Open the puttygen.exe file you downloaded when configuring PuTTY. You’ll use this to create your private/public keypair.
  2. In the PuTTY Key Generator box, make sure the radio button at the bottom is selected for RSA.
    02 putty keygen.png
  3. Click the Generate button.
  4. Move your mouse around the box to help generate the keys.
    Once the key is created, a new pop-up box appears:
    03 pubkey.png
  5. On the bottom right, there are buttons named Save public key and Save private key – save both to your computer.
    • When you save the public key, name it something like dreamhostpublickey. Do not manually add the extension as that isn’t necessary.
    • When you save the private key, name it something like dreamhostprivatekey and be sure to save it in a secure location on your computer. Again, do not manually add the extension as that isn’t necessary.
    • When saving, you are prompted with a message about a passphrase.
      Click Yes to save without a passphrase.

    If you're creating keys for MySQL Workbench

    If you're creating a key pair for MySQL Workbench, you must export the private key in OpenSSH format.

    convert to openssh key
    1. Click the Conversions tab and select Export OpenSSH key.
    2. Save this to your computer without an extension.
    You can now use this key to import into MySQL Workbench.

Uploading the public key to your server

  1. Upload the public key you just created to your DreamHost user's home directory. You can use an FTP client such as Filezilla to do this.
  2. Log in to your DreamHost web server through PuTTY.
  3. Navigate to your user's /home directory.
    [server]$ cd ~
  4. Create an /.ssh directory by running this command:
    [server]$ mkdir .ssh
  5. Change the permissions on this directory to 700.
    [server]$ chmod 700 .ssh
  6. While still in your user's home directory, append the public key you just uploaded to a new file named authorized_keys which is located in the /.ssh directory by running this command:
    [server]$ ssh-keygen -i -f dreamhostpublickey >> ~/.ssh/authorized_keys

    This appends the dreamhostpublickey you uploaded from your home computer into a new file named authorized_keys. Just make sure the name of the public key file in the command is the name of the file you uploaded.

  7. Adjust permissions by running this command:
    [server]$ chmod 600 ~/.ssh/authorized_keys

    Then remove the original file:

    [server]$ rm dreamhostpublickey

    Now the key sits on the server (protected from access by others)

  8. Log out of PuTTY and start the program up again.
  9. When the program restarts, open the configuration box and click the Connection > Data category on the left.
    04 username.png
  10. Enter your DreamHost SHELL username in the first field which is named Auto-login username.
    05 auth.png
  11. In the same configuration box, click Connection > SSH > Auth.
  12. Click the Browse button and navigate to the location on your computer where you saved your dreamhostprivatekey file.
  13. On the configuration box, click the Session category and enter the following:
  14. Click the Save button.
  15. Open PuTTY and click the new saved session you created for the passwordless login, then click the Open button. You are logged in without a password prompt.

The first time you log in, you will see a security warning about the server's host key. You can verify the key using the following article:

After you have verified the key, click the Accept button.

If the PuTTY console responds with Server Refused Our Key, this may indicate the public key PuTTY generated is not in a form the remote system recognizes or can use to authenticate your access. Refer to the following link for instructions on how to edit the public key file to a format the remote server recognizes:

See also

Did this article answer your questions?

Article last updated PST.

Still not finding what you're looking for?