Setting up passwordless login
The following are instructions on how to set up passwordless login with PuTTY.
- Open the puttygen.exe file you downloaded previously. You’ll use this to create your private/public keypair.
- In the PuTTY Key Generator box, make sure the radio button at the bottom is selected for ‘SSH-2-RSA’.
- Click the Generate button.
- Move your mouse around the box to help generate the keys.
- Once the key is created, a new pop-up box appears:
- 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.
- Upload the public key you just created to your DreamHost users home directory. You can use an FTP client such as Filezilla to do this.
- Log into your DreamHost web server through PuTTY.
- In your users /home directory, create an /.ssh directory by running this command:
[server]$ mkdir .ssh
- 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 in your users /home directory:
[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 is the name you uploaded it as.
- Adjust permissions by running this command:
[server]$ chmod go-rwx ~/.ssh ~/.ssh/authorized_keys
Then remove the original dreamhostkey.pub file:
[server]$ rm dreamhostpublickey
Now the keys sit on the server (protected from access by others)
- Log out of PuTTY and start the program up again.
- When the program restarts, open the configuration box and click the ‘Connection’ > ‘Data’ category on the left.
- Enter your DreamHost SHELL username in the first field which is named ‘Auto-login’ username.
- In the same configuration box, click ‘Connection’ > ‘SSH’ > ‘Auth’.
- Click the Browse button and navigate to the location on your computer where you saved your dreamhostprivatekey file.
- On the configuration box, click the 'Session' category and enter the following:
- Host Name: yourserver.dreamhost.com
- Port: 22
- Connection Type: SSH
- Saved Session: Enter a new name
- Click the Save button.
- Open pageant.exe on your home computer to authenticate automatically.
- It may appear as an icon on the bottom right of your toolbar.
- Right click on that icon and choose ‘Add Key’.
- Navigate to where you stored your private key on your computer and add the private key file.
- Open PuTTY and click the new saved session you created for the passwordless login. You are logged in without a password prompt.
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: