Answer the question
In order to leave comments, you need to log in
How to generate SSH keys for deployment on GitLab?
Generated SSH keys, added to Secret Variables and Deploy key, made a config according to the example , and it crashes with an error
Host key verification failed.
image: php:7.0
before_script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- mkdir -p ~/.ssh
- eval $(ssh-agent -s)
- ' && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- ssh-add <(echo "$SSH_PRIVATE_KEY")
stage_deploy:
only:
- dev
script:
- ssh [email protected]$SSH_SERVER
Answer the question
In order to leave comments, you need to log in
I would not use the agent, but would simply explicitly specify the key. That's how it works for me.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question