add script to remove localhost fingerprints i use few vms and they are populating `known_hosts` file with their fingerprints, and when i launch any other vm, ssh insults me that fingerprint is wrong and bla bla bla. so, just a little bodge.
la-ninpre leobrekalini@gmail.com
Thu, 02 Sep 2021 13:01:18 +0300
1 files changed,
17 insertions(+),
0 deletions(-)
jump to
A
bin/.local/bin/clean_local_ssh
@@ -0,0 +1,17 @@
+#!/bin/sh -e + +_known_hosts="$HOME/.ssh/known_hosts" + +grep localhost "$_known_hosts" + +printf "remove these entries? [y/N] " +read -r REMOVE +case "$REMOVE" in + [Y|y]) + grep -v localhost "$_known_hosts" | tee "$_known_hosts.new" + mv "$_known_hosts.new" "$_known_hosts" + ;; + *) + exit 1 + ;; +esac