HOW TO: Creating an SSH RSA Key with PuTTYgen.exe Print

  • 3

1) Open PuTTYgen.exe set the type to SSH2 RSA and minimum 1024 bits.

2) Click "Generate" and move your mouse in the box for randomness.

3) Edit the Comment to something you can easily identify if you plan to use multiple RSAs (different access to/from other servers, different workstations, mobile devices, etc...).

4) If you are using this RSA for an automated script do not set a passphrase. If you are using for your own use it is advised that you set a passphrase so even if somebody gets your RSA key they still cannot login to your server without entering the correct password.

5) Save the public and private keys to your PC, then copy and paste the public key in the text box to a new authorized_keys file in your .ssh folder on your VPS (mkdir .ssh && chmod 0700 .ssh && cd .ssh && touch authorized_keys && chmod 0600 authorized_keys && vi authorized_keys).

6) OPTIONAL: If you are using this for an automated script that will always be run from the same IP then we recommend you lock down that RSA key to that IP. To do so add the following before your public key in your authorized_keys file: from=""

So you're authorized_keys file should look like this:

Was this answer helpful?

« Back