Generated SSH keys, added to Secret Variables and Deploy key, made the config by example , but it falls with an error
Host key verification failed. The steps that were done:
- Generated on the server where I will deploy, and from the user who will deploy ssh-keygen -t rsa
- Added a public key from item 1 in the Deploy Keys repository with a tick. Write access allowed
- Added Private key in the secret variables of the repository in the SSH_PRIVATE_KEY variable
Config to test the connection
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) - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' - ssh-add <(echo "$SSH_PRIVATE_KEY") stage_deploy: only: - dev script: - ssh $SSH_SERVER_USER@$SSH_SERVER