Using SSH keyfile for launching agents via ssh

We use known hosts file strategy as Host key verification strategy here. Create the following Directory mkdir -p /var/lib/jenkins/.ssh Copy entries for your ssh host in the known_hosts directory ssh-keyscan -H hostname >> /var/lib/jenkins/.ssh/known_hosts Change the ownership of .ssh folder to jenkins user chown -R jenkins /var/lib/jenkins/.ssh