Skip to content

Instantly share code, notes, and snippets.

View FelikZ's full-sized avatar

Oleksii Shevchenko FelikZ

View GitHub Profile
@FelikZ
FelikZ / accept_known_hosts.sh
Created August 16, 2018 13:39
Fix known_hosts file "Jenkins Host key verification failed"
#!/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