## 给jenkins用户生成密钥对
jenkins@c9c9668e182b:/$ ssh-keygen -t rsa
直接回车确定
jenkins@c9c9668e182b:/$ ssh-copy-id -i ~/.ssh/id_rsa.pub root@服务器ip地址
## 验证
jenkins@c9c9668e182b:/$ ssh root@服务器ip地址
## 给jenkins用户生成密钥对
[root@localhost ~]# ssh-keygen
直接回车确定
[root@localhost ~]# ssh-copy-id -i ~/.ssh/id_rsa.pub root@服务器ip地址
## 验证
[root@localhost ~]# ssh root@服务器ip地址
都生成后,在Jenkins容器中使用sh命令验证
因篇幅问题不能全部显示,请点此查看更多更全内容