Add Linux Server as Jenkins Node - ChuanyuWang/test GitHub Wiki
Steps
Create user in Linux server, e.g. jenkins1
Generate SSH key for user jenkins1
Add "Credentials" in Jenkins
Choose "Kind" as SSH Username with private key
Input "Private Key" directly
Input "Passphrase" if any
Create a new node in Jenkins
Config the node as below and click "Save" button
Input "Remote root directory" as user home path, e.g. /home/jenkins1
Choose "Launch method" as Launch agents via SSH
Input "Host" with Linux server IP, e.g. 10.0.0.9
Choose "Credentials" from the user credentials just created in above step
Choose "Host Key Verification Strategy" as Known hosts file Verification Strategy, refer to help doc
Update the known_hosts file with below command. For Jenkins server running on Windows, please also check the known_hosts file from C:\WINDOWS\system32\config\systemprofile\.ssh\known_hosts