A public key and private key pair is required to administer some servers. This is a very secure way of administering a server and is needed for SFTP.
To generate an SSH2 public key and private key, follow these instructions.
- Download and install PuTTY or PuTTYgen.
- Open the PuTTYgen application.
- Click Generate.
- Move your mouse around to create a random key.
- The keys have now been created!
- Now think of a hard to guess key passphrase and enter it into the two fields. (You will need to remember this every time you use your private key).
- Click 'Save public key' and save it somewhere (e.g. with a filename mypublickey) and then click 'Save private key' and save that somewhere (e.g. with a filename myprivatekey).
- Finito!
- If you want to use SFTP, download WinSCP.
Using your SSH2 public and private keys
You will need to install the public key on your server. This key is not sensitive – you can give it out to whoever needs it.
Your private key you should keep to yourself. When you saved it, it will have saved as a file you can run. Open it and it will ask you for the key passphrase that you entered in step 6 above.
After you (or your helpful technical friend) has installed the public key on the server you need to access, open your private key on your computer. Enter the passphrase. Your key is now running and you can connect immediately using PuTTY or WinSCP or another program you intend to use.
One of the great things about SSH2 keys is that now you can connect quickly to the server without the need for extra passwords. The server knows that it must be you connecting because only these 2 keys can go with each other.