https://www.cnblogs.com/architectforest/p/13707244.html
#在前程服务器上生成密钥
https://www.cnblogs.com/zipon/p/6206063.html
more /etc/redhat-release #查看系统版本
uname -r #查看内核
ssh -V #查看ssh版本
1. ssh_keygen生成
目录/root/.ssh/id_rsa
ssh-keygen -t rsa
如果存在可以重新定义名称 jk_rsa
一路回车
会在/root/.ssh目录下 生成 id_rsa(私钥)、id_rsa.pub(公钥)
2. 复制公钥文件id_rsa.pub到authorized_keys(不存在新建)
systemctl restart sshd
3. id_rsa 只即为密钥
cd ~/.ssh
ssh-keygen -m PEM -t rsa -b 4096
jk_rsa回车回车
复制公钥文件jsk_rsa.pub到authorized_keys新建一行
systemctl restart sshd
复制jk_rsa里的keys到jenkins ssh
系统管理-SSH server->新增
name:**
hostname:19.188.222.22
username:root
Remote Directory:/data
高级:
Use password authentication,or use a different key
key:RSA_KEY 放在这里