I'm having issues deploying my git files to a ubuntu server from jenkins using ssh, which is installed on another ubuntu server.
I've tried to follow various guides such as how to setup ssh keys for jenkins to publish via ssh and https://www.youtube.com/watch?v=UPSpLDnuJC0, but without any luck. For the Stackoverflow guide i get the error jenkins.plugins.publish_over.BapPublisherException: Failed to connect and initialize SSH connection. Message: [Failed to connect session for config [webapp]. Message [java.net.ConnectException: Connection refused (Connection refused)]] and for the youtube guide i get:
Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,password).
Build step 'Execute shell' marked build as failure.
I've done ssh-keygen on the jenkins server as the jenkins user (whoami=jenkins) in the /var/lib/jenkins/.ssh/id_rsa directory, copied the contents of the id_rsa.pub file to the webapp server authorized_keys file etc. Everything done exactly as in the guides, but somehow i keep getting denied.
Ideas and help is most welcome.