diff --git a/renewkeys.sh b/renewkeys.sh index 4a9e8a8..eb881cb 100644 --- a/renewkeys.sh +++ b/renewkeys.sh @@ -179,8 +179,12 @@ if [ "$UID" -ne 0 ]; then fi echo -e ${CY}Warning: running this script resets known_hosts file. Abort this script using CTRL+C if you want to avoid that.${NF} sleep 3 +if [ -f /home/$USER/.ssh/known_hosts ]; then rm /home/$USER/.ssh/known_hosts +fi +if [ -f /root/.ssh/known_hosts ]; then rm /root/.ssh/known_hosts +fi if [ ! -f ".SSH/.temp" ]; then mkdir /.SSH/.temp fi