搜索
您的当前位置:首页正文

docker中Jenkins容器中提示Host key verification failed解决办法

来源:吉趣旅游网

1、jenkins用户生成密钥对:



## 给jenkins用户生成密钥对
jenkins@c9c9668e182b:/$ ssh-keygen -t rsa
直接回车确定
jenkins@c9c9668e182b:/$ ssh-copy-id -i ~/.ssh/id_rsa.pub root@服务器ip地址

## 验证
jenkins@c9c9668e182b:/$ ssh root@服务器ip地址

2、root用户生成密钥对:

## 给jenkins用户生成密钥对
[root@localhost ~]# ssh-keygen 
直接回车确定
[root@localhost ~]# ssh-copy-id -i ~/.ssh/id_rsa.pub root@服务器ip地址

## 验证
[root@localhost ~]# ssh root@服务器ip地址

都生成后,在Jenkins容器中使用sh命令验证

因篇幅问题不能全部显示,请点此查看更多更全内容

Top