Customers using AWS services often ask us to generate a pair of keys (public & private key) to be registered on the AWS side to be used as an authentication mechanism.
In order to democratize the knowledge of the process of generating these keys, this article will list some steps on how to generate the SSH Key, create the ".ppk" files (+ conversion to ".pem" format), and how to register these keys for use on the Digibee platform.
-> Step 1: Generating SSH Keys
Use an external SSH Key generation tool that you trust with the parameters listed below.
- Select the Algorithm to be used, in this case 'RSA'.
- Select the 'RSA Key Size', in this case '2048'.
- In the 'Passphrase' field, enter the password that will be used as the basis for key generation. Make a note of the value used in the Passphrase field, as it will be used later in the other steps.
- Copy and save the values of the 'Private Key' and 'Public Key'.
- At this point we usually already have everything (in .pem format) that the client needs to configure in AWS. That is, the Passphrase, Private Key, and Public Key.
Note: When sending to the client, send the 'Private Key' privately and separately.
- If conversion to ".ppk" format is required, go to Step (3).
Paste the 'Private Key' value into a text file, and save it in the ".pem" format.
-> Step 2: Registering the Keys on Digibee
Once we have the PrivateKey (or certificate) in ".pem" format, we must register it on the platform as a private-key account.
- Go to the 'Settings > Accounts' screen.
- Click on the 'Create' button.
- Select the Account Type as 'private-key'.
- In the 'PASSPHRASE' field, if you have it at hand, paste its value.
- In the 'KEY' field, paste the entire content of the 'Private Key' in the ".pem" format.
- Make sure you have filled in the values for both environments and click 'Confirm'.
- Now, in the component that will use the 'Private Key', just select the created Account.
-> Step 3: Creating the ".ppk" files
For this step, you will need Puttygen on your machine. To get it, simply visit this site 'https://www.puttygen.com/' and download and install it.
- Once you have PuttyGen installed, open it.
- Click on 'Load', in the window that opens, change the search to "All Files" in the box next to 'File Name'.
- Select your ".pem" format file that contains the 'Private Key', and then click Open.
- A box will open prompting you for the Passphrase value, paste it in, and then click 'OK'.
- A message should appear that the key has been successfully imported, click 'OK' again.
- Once you have the key imported into PuttyGen, the next step is to export it in ".ppk" format. Click 'Save private key' and/or 'Save public key', name the file (e.g.: privateKey.ppk) and click 'Save'.
- There you have the keys created in Step 1 now in ppk format to be used in FileZilla for example, where the keys are consumed via the ".ppk" format.
-> Bonus Step: Converting ".ppk" files into ".pem" format
For this step, you will need to have the ppk format files on hand, and Puttygen installed on the machine.
- Open Puttygen, and click on the menu above 'Conversions'.
- Select 'Import Key', and browse for your file in the ".ppk" format.
- If prompted, enter the Passphrase in the window that opens, and click 'OK'.
- Again click on menu 'Conversions' tab above, then 'Export OpenSSH Key'.
- Name the file (e.g.: privateKey.pem), and click 'Save'.
- Now you have your privateKey in ".pem" format ready to be registered in the platform.
Check out Step 2 for registering the 'privateKey' on the Digibee platform.