≡ Menu

Shell Script To Remove All Keys Belonging To Hostname From a ~/.known_hosts File

How Do I Use This Script?

Simply run it as follows:
./script.sh www-03.nixcraft.net.in

{ 1 comment… add one }
  • J. E. Aneiros March 20, 2012, 9:53 pm

    ips=$(host “$host” | awk -F’address’ ‘{ print $2}’ | sed -e ‘s/^ //g’)

    could be shorten to: ips=$(host “$host” | awk ‘/address/ { print $NF }’)

Security: Are you a robot or human?

Leave a Comment