2
votes

When I am trying to establish a connection from jenkins to the target server .I am getting the below error. I tried generating the keys newly and tried copying the id_rsa.pub to authorized keys still its not working. is there knoWN_hosts file is neccessary to establish a ssh connection..Bcause my server is missed with the knowN_hosts file. Please provide ur comments

jenkins.plugins.publish_over.BapPublisherException: Failed to connect and initialize SSH connection Message: [Failed to connect session for config]. Message [Auth fail]]

1

1 Answers

0
votes

The known_hosts file is required to connect to remote host wia Jenkins. When you try to ssh to remote server through command line, this prompt you to asking for adding this remote server to known_hosts. When you answer this prompt with 'Yes', the known_hosts file will be created automatically in ~/.ssh folder.

Then, you can connect to remote server from Jenkins UI directly.