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