Bitbucket Cloud Pipe "atlassian/scp-deploy" error - "Load key /root/.ssh/pipelines_id: invalid format"

Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.

Summary

Bitbucket Cloud Pipe provides an alternate SSH_KEY to use instead of the key configured in the Bitbucket Pipelines admin screens, which is used by default.

Example:

1 2 3 4 5 6 7 - pipe: atlassian/scp-deploy:1.2.1 variables: USER: '<string>' SERVER: '<string>' REMOTE_PATH: '<string>' LOCAL_PATH: '<string>' SSH_KEY: '<string>' # Optional.

Sometimes the Pipe will fail with 'Load key "/root/.ssh/pipelines_id": an invalid format error as shown below:

1 2 3 4 5 debug1: Next authentication method: publickey debug1: Trying private key: /root/.ssh/pipelines_id Load key "/root/.ssh/pipelines_id": invalid format debug1: No more authentication methods to try. mdo-bitbucket@xx.xx.xx.xx: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

Solution

As stated in the altassian/ssh-run pipe documentation, the alternative SSH_KEY should be base64 encoded as per the instructions given in theusing multiple ssh keys documentation, which should fix the "invalid format" error.

Updated on February 25, 2025

Still need help?

The Atlassian Community is here for you.