The before_script
in my .gitlab-ci.yml file stops while waiting for a password phrase.
- I already added the private ssh key as an environment variable
- I added the public key on the server
- I do not need a passphrase when connecting to the server via ssh
Here is my script i use:
image: docker:git
before_script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
I get the following prompt: "Enter passphrase for (stdin):"
Since the private key does not have any passphrase I assume the ssh-agent asks me if I want to add a new passphrase to my private key. How can I forward this prompt without providing any passphrase?