Created
August 16, 2018 13:39
-
-
Save FelikZ/94e67967b3b22e61d94ee68b184702d4 to your computer and use it in GitHub Desktop.
Fix known_hosts file "Jenkins Host key verification failed"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for domain in "github.com" "bitbucket.org"; do | |
echo $domain | |
sed -i "/$domain/d" ~/.ssh/known_hosts | |
line=$(ssh-keyscan $domain,`nslookup $domain | awk '/^Address: / { print $2 ; exit }'`) | |
echo $line >> ~/.ssh/known_hosts | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment