-
-
Save altif227/ce3c9b2ea46408a00ebf073089cb0c77 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