, ,

We have a Jenkins build system that performs pretty good. Then, from time to time there appears a restart and since repository is DHCP configured, Ip’s are changed. Inter dependencies are set through host/domain, and newly obtained Ip’s are declared to a local DNS but there is one more problem: Ssh authentication. As key of a remote system changes, ssh asks permission due to change, possible warning about a man in the middle. Unfortunately, this causes problem in Jenkins repository polling. For an example, here is a result of a Git commit;

ssh ip change problem -git push

We see that hook is able to trigger debian but not windows job. Possible reason is changed Ip of repository. Logging to Jenkins and making a manual ssh connection to accept the changes will just save the day, until another Ip change. Googling for a solution will yield disabling key checking through modification of ~/.ssh/config with

Host debian.sisdemo.com

    StrictHostKeyChecking no

However, this will be overkill with leading to a security vulnerability. A more subtle solution may be just ignoring Ip changes as;

ssh ip change problem - modification at ssh config

Remember that any setting in ~/.ssh/config will override /etc/ssh/ssh_config and first setting is preferred, therefore more specific ones should be placed earlier in the file.