新建用戶jenkins,並生成秘鑰
useradd jenkins su - jenkins ssh-keygen -t rsa cd /home/jenkins/.ssh cat id_rsa.pub >> authorized_keys chmod 600 authorized_keys
cat id_rsa
然后復制秘鑰,在jenkins的Credentials中新建一個用戶使用秘鑰登錄,並輸入用戶名和秘鑰,創建節點機

然后啟動節點
如果遇到報錯【The SSH key for this host is not currently trusted. Connections will be denied until this new key is authorised.】
直接節點配置里面點trust key
