SSH Remove Host Key From known_hosts

SSH: Remove Host Key From known_hosts

Sometimes you just playing around with one of your device and put static IP for the MAC address on your router, so you never bother with dynamic IP, but the drawbacks is that when you try SSH to that device show errors “WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!” and of course the solution is you must remove host key from known_hosts on your computer.

SSH Remove Host Key From known_hosts

The traditional way or maybe the usual I do is open known_hosts file at /Users/darto/.ssh/known_hosts and then delete line as shown. But there is simple way without we open first the file known_hosts, with command:

ssh-keygen -R 192.168.31.31
# Host 192.168.31.31 found: line 22
# Host 192.168.31.31 found: line 23
/Users/darto/.ssh/known_hosts updated.
Original contents retained as /Users/darto/.ssh/known_hosts.old

I hope this post make me remember the command (•‿•).

Baca juga:  Rocky Linux - Cockpit Dengan SSL Let's Encrypt

Tinggalkan Komentar

Alamat email Anda tidak akan dipublikasikan. Ruas yang wajib ditandai *


The reCAPTCHA verification period has expired. Please reload the page.