Resolving hanging SSH when using sshpass with a private key that has a passphrase

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

Summary

Users may experience SSH hanging when using sshpass in combination with a private key that has a passphrase, for example:

1 2 sshpass -p password ssh $user@server -v debug1: Trying private key: /opt/atlassian/pipelines/agent/ssh/id_rsa

Solution

Include the -P assphrase flag in the sshpass command. Here's an example of how to use the command:

1 sshpass -p password -P assphrase ssh $user@server -v

Adding the -P assphrase flag, you can prevent SSH from hanging and ensure a successful connection using the private key with a passphrase.

Updated on February 25, 2025

Still need help?

The Atlassian Community is here for you.