-
Type:
Suggestion
-
Resolution: Unresolved
-
Component/s: Pipelines - SSH Keys
-
None
-
1
Currently, Bitbucket Pipeline SSH keys - https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/#Use-SSH-keys-in-Bitbucket-Pipelines is only supported in Linux Docker Runners.
Customers would like this to also support Linux Shell and Windows Runners as managing SSH keys per runner or repository can be tedious and is additional overhead for the customer. This is documented as a Limitation of Runners - https://support.atlassian.com/bitbucket-cloud/docs/set-up-runners-for-linux-shell/#Unsupported-features
Workaround
We can manually add create and add the key directly on to the runner and it will work within Pipelines. These commands will help create and add the SSH key on the runner correctly for Linux Shell -
## Create Key
cd ~/.ssh
ssh-keygen -t ed25519 -b 4096 -f {ssh-key-name}
## Update known_hosts
ssh-keyscan -H bitbucket.org >> ~/.ssh/known_hosts
## Create config
cd ~/.ssh
touch config
Add this to your config
HostName bitbucket.org IdentityFile ~/.ssh/<ssh-key-name>