2013年6月17日 星期一

[jenkins] How to setup a Jenkins slave with ssh password

How to setup a Jenkins slave with ssh password
ETA: 5 mins


You can use any Linux machine as a Jenkins slave, if you have the username and password.
Cool.




Quick Guide (3 steps)
Slave Machineu
# Step 1: [Slave] Create Account for Autobuild
slave:~$ sudo adduser jing_autobuild


Jenkins Master Machine
# Step 2: Create Credential for Connecting the Server
[Manage Jenkins] -> [Manage Credential] -> [Add Credentials]
SSH Username with password


Info
Username: jing_autobuild
Password:


# Step 3: Create Node
[Manage Jenkins] -> [Manage Node] -> [New Node]


Info
Remote FS root: /home/jing_autobuild
Host: [slave ip]
Credentials: [select credentials which created on step 2]




Detail
3 steps guide for setup a Jenkins slave with user password.


On your slave machine
Step 1: [Slave] Create Account for Autobuild
slave:~$ sudo adduser jing_autobuild
slave:~$ sudo adduser jing_autobuild sudo


On your jenkins master
Step 2: [Jenkins Master] Create Credential for Connecting the Server
  [Manage Jenkins] -> [Manage Credential] -> [Add Credentials]
Select: SSH Username with password


Setup the username and password
Username: the username for access the slave machine
Password: the password of the user jing_autobuild on slave machine
ex:
Step 3: [Jenkins Master] Create Node
[Manage Jenkins] -> [Manage Node] -> [New Node]
Node Name: Jing_Slave1
Dumb Slave: Checked




Result