Created
September 21, 2017 21:12
-
-
Save slumos/1c37c91c4fe49a43ab472bac848eb4b9 to your computer and use it in GitHub Desktop.
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
21Sep 14:10:47 ~ 0% which fssh | |
fssh () { | |
hosts="$1 $(getent hosts $1)" | |
if [ -x /usr/bin/dscl ] | |
then | |
hosts="$hosts $(dscl . read /Hosts/$1 | awk '/^IPAddress/ { print $2 }')" | |
fi | |
for h in ${=hosts} | |
do | |
ssh-keygen -R $h >&/dev/null | |
done | |
ssh-keyscan -tdsa,rsa ${=hosts} >> $HOME/.ssh/known_hosts 2> /dev/null | |
ssh $* | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment