Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

SSH connection fails in Bitbucket pipeline

Robert-Paul
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 27, 2025

Hi everyone,

I’m stuck with the following Bitbucket pipeline YAML script. When the runner tries to connect to another server via SSH, it fails, even though the private/public key pair is correctly set up. From the machine running the runner, the SSH connection works fine, but not from within the runner process itself

 

+ ssh -o StrictHostKeyChecking=no $SSH_USER:$SSH_HOST << EOF
echo 'Run deploy...'
docker stop xyz-website || true
docker rm xyz-website || true
docker run -d \
--name xyz-website \
-p 80:5010 \
--restart always \
echo 'Deployment finished.'
EOF
And here’s the error output:
Pseudo-terminal will not be allocated because stdin is not a terminal.
Warning: Permanently added '<HOST>,<IP>' (ECDSA) to the list of known hosts.
ssh_askpass: exec(/usr/bin/ssh-askpass): No such file or directory
Permission denied, please try again.
ssh_askpass: exec(/usr/bin/ssh-askpass): No such file or directory
Permission denied, please try again.

It seems like SSH is falling back to a password prompt when the public/private key authentication fails, but since there’s no ssh-askpass available, the connection breaks.

Has anyone run into this before? Or is there something I’m missing in how Bitbucket handles SSH keys inside the runner process?

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin Site Admin
TAGS
AUG Leaders

Atlassian Community Events