Jenkins使用SSH远程发布

远程发布需要安装Publish Over SSH插件

比如我们的应用服务器都是通过tomcat用户启动程序,因此,在jenkin服务器上配置免密登录远程服务器tomcat用户

//生成密钥对
ssh-keygen -t rsa  (为了安全最好设置密码)

//把公钥加入到远程服务器tomcat用户
ssh-copy-id -i ~/.ssh/id_rsa.pub  tomcat@<remote_host>

有多台远程主机则复制多个

Jenkins配置

系统管理--->系统设置--->Publish over SSH

在项目中使用Publish over SSH

原文地址:https://www.cnblogs.com/sellsa/p/8316683.html