GNU/Linux >> Linux Esercitazione >  >> Linux

Correzione dell'errore "AVVISO:L'IDENTIFICAZIONE DELL'HOST REMOTO È CAMBIATA" in Linux

Oggi ho provato a eseguire l'SSH nel mio server remoto Ubuntu 20.04 LTS e ho riscontrato questo messaggio - AVVISO:L'IDENTIFICAZIONE DELL'HOST REMOTO È CAMBIATA! .

$ ssh [email protected]

Risultato di esempio:

@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:K/jEKNQCYYOilJxOZc7qAWlu4xu0nW+MD09DfJL7+gc.
Please contact your system administrator.
Add correct host key in /home/sk/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /home/sk/.ssh/known_hosts:11
  remove with:
  ssh-keygen -f "/home/sk/.ssh/known_hosts" -R "192.168.225.52"
ECDSA host key for 192.168.225.52 has changed and you have requested strict checking.
Host key verification failed.

Errore - AVVISO L'IDENTIFICAZIONE DELL'HOST REMOTO È CAMBIATA

Questo in realtà non è un messaggio di errore. È solo una notifica di sicurezza che indica che la chiave host ECDSA per il sistema remoto specificato è cambiata dall'ultima connessione. Come forse già saprai, quando accediamo a un sistema remoto per la prima volta da un sistema locale tramite SSH, un'impronta digitale per la chiave ECDSA inviata da quell'host remoto viene memorizzata nella cache e archiviata in $HOME/.ssh/known_hosts file nel nostro sistema locale.

Quando l'identità (impronta digitale) è cambiata dopo aver reinstallato il sistema remoto o aver assegnato lo stesso indirizzo IP a più sistemi remoti, viene visualizzato il messaggio di avviso precedente.

Correzione dell'errore "AVVISO:L'IDENTIFICAZIONE DELL'HOST REMOTO È CAMBIATA" in Linux

Per risolvere questo problema, è sufficiente rimuovere la chiave memorizzata nella cache per l'indirizzo IP sul sistema locale utilizzando il comando:

$ ssh-keygen -R 192.168.225.52

Risultato di esempio:

# Host 192.168.225.52 found: line 11
/home/sk/.ssh/known_hosts updated.
Original contents retained as /home/sk/.ssh/known_hosts.old

Correzione dell'errore "AVVISO:L'IDENTIFICAZIONE DELL'HOST REMOTO È CAMBIATA" in Linux

Puoi anche specificare in modo esplicito il percorso del file known_hosts con -f segnala come sotto.

$ ssh-keygen -f "/home/sk/.ssh/known_hosts" -R "192.168.225.52"

Il comando precedente eliminerà tutte le chiavi appartenenti all'host remoto da known_hosts file del sistema locale. E anche i vecchi contenuti di known_hosts il file verrà conservato in un file chiamato "known_hosts.old ".

Se utilizzi una porta SSH diversa, devi menzionarla esplicitamente come di seguito:

$ ssh-keygen -R 192.168.225.52:1234

Qui, 1234 è il numero di porta SSH. Sostituiscilo con il tuo numero di porta SSH effettivo.

Dopo aver rimosso le chiavi, riprova ad accedere a SSH nel sistema remoto usando il comando:

$ ssh [email protected]

Digita "sì" e premi INVIO per aggiungere la chiave dell'host remoto nel tuo sistema locale:

The authenticity of host '192.168.225.52 (192.168.225.52)' can't be established.
ECDSA key fingerprint is SHA256:K/jEKNQCYYOilJxOZc7qAWlu4xu0nW+MD09DfJL7+gc.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.225.52' (ECDSA) to the list of known hosts.
[email protected]'s password:

Ora puoi accedere al sistema remoto tramite SSH.


Linux
  1. Come sono cambiati i test di Linux e cosa conta oggi

  2. Fix FirewallD non esegue errori su Linux Mint 12

  3. Linux – L'output di Ps Lstart è cambiato?

  4. Come correggere l'errore "verifica della chiave host non riuscita"

  5. sshfs non riesce con l'host remoto disconnesso

Come aggiungere host Linux e Windows remoti a Icinga 2 per il monitoraggio

Come aggiungere un host Linux remoto a Cacti per il monitoraggio

Correggi BASH minimo come la modifica della linea è supportata Errore GRUB in Linux

Come correggere l'errore cPanel:l'indirizzo IP è cambiato?

Come eseguire il backup dell'host Linux remoto utilizzando l'utilità rsnapshot rsync

Avviso di elusione dell'identificazione dell'host remoto è cambiato