Set up passwordless login in PuTTY

 

Overview

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

The following generates the access key that will be used with PuTTY.

  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, select the radio button at the bottom for Ed25519.
  3. Click the Generate button.
  4. Move your mouse around the box to help generate the key.
    Once the key is created, a new pop-up box appears:
    Puttygen key
  5. Click both the Save public key and Save private key buttons that appear on the bottom right to save these keys to your computer.

    Recommendations when saving the generated keys:

    • 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.

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.
  2. Select Export OpenSSH key.
  3. 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

To upload and implement the access key that you generated previously:

  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 the following command:
    [server]$ mkdir .ssh
  5. Change the permissions on this directory to 700:
    [server]$ chmod 700 .ssh
  6. Append the public key you just uploaded to a new file named authorized_keys, which is located in the /.ssh directory by running the following:
    [server]$ ssh-keygen -i -f dreamhostpublickey >> ~/.ssh/authorized_keys

    Make sure the name of the public key file in the command is the name of the file you uploaded.

  7. Adjust permissions by using this command:
    [server]$ chmod 600 ~/.ssh/authorized_keys
  8. Then, remove the original dreamhostkey.pub file:

    [server]$ rm dreamhostpublickey
    The key is saved on the server (protected from access by others).

Configuring the automatic login

The following steps complete the configuration in PuTTY for a passwordless login.

  1. Open PuTTY to access its configuration menu.
  2. Click Connection > Data category on the left.
    Putty auto
  3. Enter your DreamHost shell username in the field named Auto-login username.
  4. Click Connection > SSH > Auth.
    Putty credentials
  5. Click the Browse button and navigate to the location on your computer where you saved your dreamhostprivatekey file.
  6. In the configuration menu, click the Session category and enter the following:
    • Host Name: yourserver.dreamhost.com (this is your DreamHost servername)
    • Port: 22
    • Connection type: SSH
    • Saved Sessions: Enter a new name
    Putty login
  7. Click the Save button.
  8. 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, a security message warns you about the server's host key. You can verify the key using the instructions in this article.

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

See also

Did this article answer your questions?

Article last updated PST.

Still not finding what you're looking for?