How to replace or regenerate the elasticbamboo.pk used for Elastic Bamboo
Purpose
Elastic Bamboo stores an SSH private key at <bamboo-home>/shared/configuration/elasticbamboo.pk
The purpose of this key is to:
- To allow administrators to SSH into running Bamboo Elastic agents.
- Within the application; it is used to decrypt the RDP Password for Windows instances and display it in the UI for remote access purposes.
Bamboo can operate Elastic Bamboo functionality fine without this key but remotely accessing the agents outside of Bamboo will be impossible.
The purpose of this knowledge-base article is to show you how to regenerate it if it becomes mismatched at some point or replace it entirely if you want to change the SSH key that Elastic Bamboo utilizes.
Solution
- Remove any existing
elasticbamboo.pk
file from the filesystem on the Bamboo Server at:<bamboo-home>/shared/configuration/elasticbamboo.pk
- Log in to the AWS EC2 Console.
- Change the Region in the AWS console to the Region that your Elastic Bamboo is configured to launch agents into. E.g. Asia Pacific (Sydney).
- Visit Keypairs in the AWS EC2 console.
- Delete any existing keypair called elasticbamboo from AWS EC2 Keypairs.
- Follow either Method 1 or Method 2 depending on your requirements:
Method 1: Have Bamboo regenerate a new private key
The next time Bamboo starts an Elastic Agent, the keypair will be regenerated and saved at <bamboo-home>/shared/configuration/elasticbamboo.pk
. You could force this by manually starting an agent at Bamboo Administration >> Elastic Instances >> Start new elastic instances
.
Method 2: Generate or import your own via the AWS EC2 Console
- In the same EC2 Keypairs UI in the AWS Console, either:
Create keypair with name elasticbamboo. The keypair will be automatically downloaded to your local filesystem via the browser.
It needs to be named elasticbamboo.pk but AWS will create it with a .pem extension. Make sure to rename the extension during the copy in Step 2.
- Import keypair with name elasticbamboo and upload your exsting SSH key.
- Copy the keypair that was either downloaded or imported to the Bamboo Server filesystem at:
<bamboo-home>/shared/configuration/elasticbamboo.pk