일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
- Android
- SSH
- apple
- openssl
- OSX
- SSL
- otpkey
- 앱스토어
- git
- 애플
- albumbook
- SwiftUI
- MYSQL
- FIDO2
- WebAuthn
- SWIFT
- appres
- fido
- 인증
- kmip
- Xcode
- 앱리소스
- css
- OTP
- Nodejs
- 2FA
- 앨범북
- MFA
- MSYS2
- 안드로이드
- Today
- Total
인디노트
How to setup a Jenkins slave with ssh private key 본문
How to setup a Jenkins slave with ssh private key
(Copy and Past, Enter Directly Version)
Jing, mqjing@gmail.com
Quick Guide (4 steps)
ETA: 10 mins
Slave Machine # init: [Slave] Create Account for Autobuild slave:~$ sudo adduser jing_autobuild # Step 1: Create private key and public key slave:~$ ssh-keygen -t rsa -C "The access key for the slave Jing" (note: Enter passphrase) Output: private key: id_rsa # copy to master public key: id_rsa.pub # copy to slave (.ssh/authorized_keys) # Step 2: Setup Authorized key slave:~$ cat id_rsa.pub > ~/.ssh/authorized_keys Jenkins Master Machine # Step 3: Setup the Credential key [Manage Jenkins] -> [Manage Credential] -> [Add Credentials]: Select: SSH Username with private key
Info # you are on the slave (a) copy the private key slave:~$ cd .ssh;cat id_rsa # you are on the Jenkins master (b) paste to the jenkins master board Private key: Enter directly: <private key ascii> # Step 4: Create Node [Manage Jenkins] -> [Manage Node] -> [New Node] Info Remote FS root: /home/jing_autobuild Host: <slave ip> Credentials: <select credentials> |
Detail
Step 1: Create private key and public key (detail)
You are on slave machine
slave:~$ ssh-keygen -t rsa -C "The access key for the slave Jing" Output: private key: id_rsa # for jenkins master to connect this slave public key: id_rsa.pub # for this slave to verify the connection from jenkins master Note: You should enter a strong passphrase for your key. If you do not use passphrase, anyone can commit your codes when the keys were stolen. |
example:
Step 2: Setup the public key as the authorized key for verifying the credential key from the master
You are on slave machine
slave:~$ cat id_rsa.pub > ~/.ssh/authorized_keys |
example:
Step 3: Setup the the credential key
You are on the Jenkins master
[Manage Jenkins] -> [Manage Credential] -> [Add Credentials]:
Select: SSH Username with private key
Setup the username and key
Username: the username for access the slave machine
Key: copy private key
Step 1: cat the private key from the slave machine ex: # you are on the slave slave:~$ cd .ssh;cat id_rsa Step 2: copy the content to the jenkins master board ex: # you are on the jenkins master |
Setup the credential for the node
[Manage Jenkins] -> [Manage Node] -> select node -> [Configure]
See the connection status
'개발 플랫폼 및 언어' 카테고리의 다른 글
아파치 웹서버 2.4 컴파일 (0) | 2017.03.14 |
---|---|
SSH Key - 비밀번호 없이 로그인 (0) | 2017.03.04 |
리눅스 그룹 관련 명령들 (0) | 2017.03.04 |
Jenkins Git 서버 연동시 에러 (0) | 2017.03.04 |
Spring source 배포 및 Tomcat Server 셋팅 (0) | 2017.02.27 |