1. 程式人生 > >jenkins 遠程連接linux配置

jenkins 遠程連接linux配置

Jenkins

1、Jenkins主機密鑰生成:
ubuntu@jenkins:~$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/ubuntu/.ssh/id_rsa):
Created directory ‘/home/ubuntu/.ssh‘.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/ubuntu/.ssh/id_rsa.
Your public key has been saved in /home/ubuntu/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:SlT+XQJE3mkvMioUEVSWiAmkSJ58QT7p5JoIi4ucynA ubuntu@jenkins
The key‘s randomart image is:
+---[RSA 2048]----+
| o++ ++++++ |
|=.o = .=.. o . |
|o+ * o . . = . |
| = .. . . o + |
|. o o S + o . |
|+.o o . . o . |
|=oE o . |
|=o. . |
|=+ |
+----[SHA256]-----+

2、將公鑰拷貝到authorized_keys
ubuntu@jenkins:~/.ssh$ cat id_rsa.pub >> authorized_keys

3、拷貝公鑰到遠程主機
ubuntu@jenkins:~$ ssh-copy-id -i [email protected]

4、配置jenkins的SSH server
點擊右上角Jenkins——》菜單“系統管理”——》系統設置——》Publish over SSH
技術分享圖片

jenkins 遠程連接linux配置