TASTE-OF-IT

SSH – Warning: the ECDSA host key for differs from the key for the IP address

Unix Shell

Unix Shell

Folgende Meldung wird angezigt, wenn sich der SSH Key für einen Rechner geändert hat

# ssh rechner
Warning: the ECDSA host key for ‘rechner’ differs from the key for the IP address ‘192.168.0.36’
Offending key for IP in /etc/ssh/ssh_known_hosts:2
Matching host key in /root/.ssh/known_hosts:3
Are you sure you want to continue connecting (yes/no)? n
Please type ‘yes’ or ‘no’:

entfernen des Key mittels:

# ssh-keygen -R hostname
# ssh-keygen -R 192.168.0.36

oder gleich aktualisieren, was bei mir besser funktionierte. Der Pfad ist abhängig von obiger Meldung und muss entspr. angepasst werden.

# ssh-keyscan -t ecdsa hostname>> ~/.ssh/known_hosts
# ssh-keyscan -t ecdsa 192.168.0.36 >> ~/.ssh/known_hosts
# ssh-keyscan -t ecdsa hostname>> /etc/ssh/known_hosts
# ssh-keyscan -t ecdsa 192.168.0.36 >> /etc/ssh/known_hosts

wenn das nicht klappt dann:

# sed -e '2d' /etc/ssh/known_hosts
# sed -e '3d' ~/.ssh/known_hosts
Die mobile Version verlassen