Last active
January 22, 2018 11:58
-
-
Save takenoko-str/e8375dbcc8b0adaef57eb2ed0d6942ff to your computer and use it in GitHub Desktop.
know_hosts on development environment
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/sh | |
# escape know_hosts problem | |
# if you can not connect remote-server with ssh because of changing dns record frequestly, | |
# you can use this script. set error message "Offending key for IP in /home/takenoko/.ssh/known_hosts:688" | |
argv=$1 | |
known_hosts=$(echo $argv | awk -F':' '{print $1}') | |
if [ -z $konw_hosts ]; then | |
exit 1 | |
fi | |
line=$(echo $argv | awk -F':' '{print $2}') | |
if [ -z $line ]; then | |
exit 1 | |
fi | |
sed -i.bak -e "${line}d" $known_hosts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ssh -o 'StrictHostKeyChecking no' -i ~/.ssh/mykey.pem ubuntu@x.x.x.xでよかった。