Jenkins中node节点添加之SSH方式

DevOps 未分类评论1,992字数 2337阅读7分47秒阅读模式

安装SSH插件

Jenkins中node节点添加之SSH方式

配置启用SSH Server

Jenkins中node节点添加之SSH方式

Jenkins主机master生成SSH密钥

[root@iZ8vb5r55ch4ajtzom2jiqZ ~]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:usmPd3ZuDAJnZoOP7mJuIdf62S+MUqIoD/H0c7Fq07U root@iZ8vb5r55ch4ajtzom2jiqZ
The key's randomart image is:
+---[RSA 2048]----+
|                 |
|                 |
|       .         |
|      o *        |
|. .  ..OS.       |
| +..+ +++ .      |
|...+oB++ o o     |
|o.. O=+*E o +    |
|...=o*Ooo=.+.    |
+----[SHA256]-----+

发送Jenkins主机公钥至要远程主机上

[root@devops-prometheus ~]# ssh-copy-id 10.1.0.182

添加Jenkins主机SSH私钥key为凭据

[root@devops-prometheus .ssh]# cat id_rsa
-----BEGIN RSA PRIVATE KEY-----
MIIEogIBAAKCAQEA29jaWL0jGS7TfapCgJrrGUr2aPnvIRa7HA0fef9+wg0l1Ow2
FY12RphTyILhnn2GQiXII9h6+1dxrr0Cm5fIgG1wC+hvmu++FP7o/Bjl8IfNBWOQ
VDRbli6EmylXQnZDvQXmVf4sxosu+ii/IAEni/6GZvOozCH9a05O0rOTWGlBusH8
XxM8QK4WtjKrvBb06QeCMimZLIYd2nAcnBAa4K8XsnrZvT9+3PxnqxG4XYSjYUAf
GDnLjrHXYN67tEl/ZkHcUCh+2dYl5qIGBFGKd9Nhq8bkXeoNiXk/qGZ9hSfHaCTC
V5jAueF5BoaMxANPPqi20rUMtRHDMBh3G9nLBwIDAQABAoIBACUhqjdEsrHlK8lU
wWixQbYC6D1wwUfIbA/f04oqcgFacSJWRwg63VgtEDG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fxf3YBJQtv6INv3d8kTRm5srWGfhNlDX3+
iPHu8d+Mmmus2ZzQ825C+iabI9PVo4rTP/bVOjkCxHCgaq65/lA=
-----END RSA PRIVATE KEY-----

Jenkins中node节点添加之SSH方式

添加从节点

Jenkins中node节点添加之SSH方式

继续阅读
DevOps
  • 本文由 发表于 2022年12月30日 15:41:32
  • 除非特殊声明,本站文章均为原创,转载请务必保留本文链接
zabbix5.0企业微信报警 未分类

zabbix5.0企业微信报警

先去申请企业微信,要以管理员的权限创建机器人,建完机器人后会有一串webhook。 创建报警类型 脚本名称就是刚才创建的python脚本 {ALERT.SENDTO}...
评论  0  访客  0

发表评论