From 12a23949a4de1ee98db8855520741494d3651062 Mon Sep 17 00:00:00 2001 From: la-ninpre Date: Thu, 2 Sep 2021 13:01:18 +0300 Subject: 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. --- bin/.local/bin/clean_local_ssh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 bin/.local/bin/clean_local_ssh (limited to 'bin') diff --git a/bin/.local/bin/clean_local_ssh b/bin/.local/bin/clean_local_ssh new file mode 100644 index 0000000..54b67a9 --- /dev/null +++ b/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 -- cgit v1.2.3