Publish Over SSH | Issue with intermediate host which has custom port


Jenkins installed on server A is trying to connect to server B which has public IP 46.X.X.X and internal IP

The public IP has the SSH on port 221 and the internal one on port 22.

Using the settings in the screenshots below when I test the connection in the control panel it connects successfully but when I try to do the same thing in a job, it doesn’t work and returns the error below: