最近研究gitlab-CI/CD时,job运行报错,查看日志信息
$ scp code/*.sh root@11.22.33.55:/root/
Host key verification failed.
报错信息或者是“Permission denied, please try again.”
解决方案:
1.参考官方文档,在本地搭建的gitlab的以下路径中找到官方的ssh_keys文档内容
http://11.22.33.44:18080/help/ci/ssh_keys/README.md
How it works(步骤):
1.Create a new SSH key pair locally with ssh-keygen
2.Add the private key as a variable to your project
3.Run the ssh-agent during job to loadthe private key.
4.Copy the public key to the servers you want to have access to (usually in ~/.ssh/authorized_keys) or add it as a deploy key if you are accessing a private GitLab repository.
我们的gitlab-runner是用docker拉起来的,所以主要讲解(SSH keys when using the Docker executor)
实现流程:
1.You will f