Our team runs a lot of Jenkins jobs using Publish over SSH. Many of them use long-running SQL queries and all timeouts in Publish over SSH have been disabled. However, we are running into server SSH inactivity timeouts, set as ClientAliveInterval 1500 in /etc/ssh/sshd_config for security reasons.
One workaround we tried is to configure server-alives on a client side of the Jenkins server in ~/.ssh/config of the Jenkins user:
This approach did not work. What worked is a wait/print loop in every remote script that needs to be executed. It works like this:
This works, but it's a hassle to be adding wait/print loops into each script we execute. It'd be very nice if Publish over SSH supports periodic server-alive messages or some other option to suppress server inactivity timeouts.