Thank you for visiting the Rackspace Community
The The Community is live! Post new content or topics so our teams can assist.

Please contact your support team if you have a question or need assistance for any Rackspace products, services, or articles.

How to setup PUTTY to support to use authorized_keys

Setting Putty up to do SSH auto-sign on

You will need to download PUTTYGEN, PUTTY

  1. Open PUTTYGEN.exe
  2. This will generate your private public key pair that you will use to sign into your Linux server
  3. You will want to change the number of bits to generate the key from 1024 to at least 2048
  4. You will also need to decide what type of key you want to generate *SSH-1(RSA), SSH-2 RSA, or SSH-2 DSA
  5. Click the Generate button
  6. You will need to move your mouse around on the PUTTYGEN windows to generate hash of the key
  7. At this point you can chose to add a passphrase
  8. Do not close the PUTTYGEN.exe

*You should not generate a SSH-1(RSA) as this is for backwards compatibility only and is not secure.

This creates a key pair that is password locked this cause the server to ask for a password when you log into the server along with using the SSH public/private key pair

    1. You will then need to save the public key and the private key
    2. You should name the public key with .pub extension and the private key should have a .ppk extension

Please save them to secure place on your harddrive that only the user has access too

A good idea is to backup the public and private key pair to a usb flashdrive and store the key in secure location. Encase something happens to the key pair stored on your system

Install public key on the remote server:

  1. Open Putty
  2. Connect the remote server using putty.exe
  3. Create folder .ssh in the user home directory: mkdir ~/.ssh
  4. Change the permission on the .ssh folder to 700: chmod 700 ~/.ssh
  5. Then open the ./ssh/authorized_keys with vi: vi .ssh/authorized_keys
  6. Enter edit mode by pressing "i"
  7. Go back to PUTTYGEN.exe on your local system
  8. In the PUTTYGEN.exe window you will see the Public Key for pasting into OpenSSH authorized_keys file
  9. You will need to select the key that is shown it will start with ssh-rsa or ssh-dsa depending on which key pair was created it will end with the Key comment

You can also open the public key in notepad and copy the key from there (the text editor you use most not change the formatting or else the key will not work. The authorized_keys file stores all of your public keys for this server. .ssh/authorized_keys file stores each key on single line. This is way you need to open the file in a text editor that does not change the text formatting

  1. Once you have the key copied you will need to paste the key into the open .ssh/authorized_keys in putty.exe
  2. Then press esc to exit edit mode
  3. Press : and type wq to write the changes to the file and quit out of vi
  4. Make sure the authorized_keys has the permission of 600 and the know_hosts has the permission of 644 as OpenSSH will complain about the key being to public

Configure Putty to send the private key:

  1. Open a new putty window
  2. Type in the IP address or the hostname of the server where the public key is install
  3. Enter a name for server in the saved Sessions text file
  4. Then click Save
  5. Next on the tree view click the plus sign next to SSH
  6. Then click Auth under SSH
  7. Next click browse next to Private key file for authentication:
  8. Navigate to the private key you created and saved to the hard drive

If you would like to setup auto-login

  1. Click Data under Connection
  2. Then type in the username for the user on the server where you saved the authorized_keys file on the server
  3. Now click on the Session field then click on the server name you created before and click Save
  4. If everything was correct when you connect you will see Authenticating with public key "Name of the Key"