Configuring SSH access to servers for your builds and deployments on Bitbucket Pipelines used to be a real pain. We had a manual process that involved generating keys locally, then base64 encoding them to pass through environment variables in your build. You also needed to add hosts to the SSH known_hosts file so various commands didn’t fail with cryptic error messages. We saw an opportunity to make this experience a whole heap better.
Improved SSH configuration for Pipelines
We’ve designed a new configuration screen for your Bitbucket repository that lets you generate and configure SSH keys for your pipelines with a single click. The private key will be encrypted, kept securely within Bitbucket, and automatically registered in your pipeline build container. You then simply copy/paste the public key on to your remote host to give your build access to it.
Adding your remote hosts to the known_hosts file in your build is just as easy. Type in the hostname and Bitbucket automatically pulls down the host’s public key, and lets you verify the fingerprint. If everything looks is okay, add your hosts to the configuration with a single click.
With these small improvements, configuring SSH access for Pipelines now takes just a few seconds instead of half an hour of error-prone tweaking.
Learn more about using SSH keys in Pipelines. Happy Pipelining!