Add Linux Server as Jenkins Node - ChuanyuWang/test GitHub Wiki

Steps

  1. Create user in Linux server, e.g. jenkins1
  2. Generate SSH key for user jenkins1
  3. Add "Credentials" in Jenkins
    1. Choose "Kind" as SSH Username with private key
    2. Input "Private Key" directly
    3. Input "Passphrase" if any
  4. Create a new node in Jenkins
  5. Config the node as below and click "Save" button
    1. Input "Remote root directory" as user home path, e.g. /home/jenkins1
    2. Choose "Launch method" as Launch agents via SSH
    3. Input "Host" with Linux server IP, e.g. 10.0.0.9
    4. Choose "Credentials" from the user credentials just created in above step
    5. Choose "Host Key Verification Strategy" as Known hosts file Verification Strategy, refer to help doc
  6. 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
ssh [email protected]