Generating an SSH Key Pair for SFTP
The steps to generate the key will differ based on your computer's Operating System:
Linux & macOS:
- Open a terminal window.
- Enter the following command:
ssh-keygen -t rsa
If you receive an error here, verify that you have OpenSSL installed. Then try again. - Select the default values for all options.
This command generates two SSH key files,id_dsa
andid_dsa.pub
, in the users home directory. - Send the public key file
id_dsa.pub
to your partner representative.
Windows:
- Download PuTTYgen.exe and run it. Putty gen is included with the windows MSI installer.
- Launch Putty Key Generator and in the menu select key.Select the SSH-2 RSA radio button, in the Parameters section near the bottom of the page select RSA. For number of bits in a generated key enter 2048.
- Click the Generate button.
- Move the mouse around in the blank area as instructed, until PuTTYgen generates the key pair.When PuTTYgen has generated the key, it replaces the blank area with a series of text boxes, including one that shows the public key.
- Click the Save public key button and save the public key with the name id-rsa in the folder
C:\Documents and Settings\username\.ssh
, where username is your Windows user name. - Click the Save private key button and save the private key with the name id-rsa.ppk in the same folder.
- Copy to the clipboard the contents of the text box Public key for pasting into OpenSSH authorized_keys file.Make sure to copy the entire content, starting with
ssh-rsa
and ending with the email address you entered in Step 5. - Close PuTTYgen.