If All Else Fails Try Again Solution Posters
Solving Jenkins "stderr=Host key verification failed" problem when all else fails
TLDR;
The key to solving the trouble is to ensure the host is verified (i.east. the remote is added to known_host) on the originating server, before attempting to interact with it via the Jenkins interface.
- Log in to the Jenkins server as the Jenkins user,
- Attempt to log into the remote accost in question due east.yard. `ci@remote-host`,
- When greeted with the message "The authenticity of host 'X.X.X.X (X.X.Ten.10)' tin can't be established.", blazon 'aye' and proceed.
- Then, go back to your Jenkins to retry the operation that failed initially.
My experience
All-twenty-four hour period I write code, however, there are very few times I need to consummate some deployment task when I face some challenges I do whatever information technology takes to get it resolved and often (only almost 95% of the time) forget to document. This means if I become unlucky and experience the same consequence, there are chances I must accept forgotten the solution the final time.
This fourth dimension effectually, I was trying to set upwards a pipeline on Jenkins to trigger a docker service update whenever the main Github branch gets updated. I kept on encountering a problem every bit shown below:
Quick google searching lead me to these results (ane and 2), just I was non able to brand much use of them, since I was sure I had those basics covered.
I knew I had seen this before, I knew it related to "Host Verification" as shown, merely my attempts to ready information technology seemed bootless. I had ensured the following:
- The user I attempted to apply on the remote host exists i.e. `ci@remote-host`,
- I copied over the public key (~/.ssh/XX_rsa.pub) from the Jenkins server to the remote host'due south authorized_keys file (Append to ~/.ssh/authorized_keys),
- The private fundamental was set up correctly on the Jenkins manage credentials console.
After validating all these, the outcome persisted, before I somewhen had a brain wave that pb to the post-obit:
- I needed to log on to the Jenkins server 1 more time
$ ssh user@jenkins-host
- If
user
above is not the aforementioned user for the Jenkins interface, then y'all need to change to the right user$ su jenkins
- And so I tried the command I wanted to run on the remote again
$ docker -H ssh://ci@remote-host
, at this point, I got the exact same mistake as in the screenshot above, I knew I had found my solution 🙂 - And so, I attempted to log in to the remote organization from the aforementioned Jenkins-user console
$ ssh ci@remote-host
and saw the bulletin validating the authenticity of the remote host. - I typed in yes at the prompt `Are you certain you desire to continue connecting (aye/no)? yes`.
- At this point, y'all might be able to admission the remote host, otherwise, you volition get a dissimilar message. An case, I got
Permission denied (publickey).
considering the public-private primal combination I used was not saved on the Jenkins-user'southward home/.ssh directory. - If you lot besides get the public key error, and you lot are unsure how to proceed, peradventure you can create a new public-private key combination
ssh key-gen
and create a new setup with that.
I have ever wished to share but never could brand out time, this is my offset and I hope someone somewhere finds this write-upwards useful and time-saving.
sinclair-maclagansuchang.blogspot.com
Source: https://medium.com/@alli5723/solving-jenkins-stderr-host-key-verification-failed-problem-when-all-else-fails-efcbce67f9a2?source=read_next_recirc---------2---------------------996cf2da_46e0_445b_a31b_09b09169ad53----------
0 Response to "If All Else Fails Try Again Solution Posters"
Post a Comment