ssh rifiuta la connessione con il messaggio "no hostkey alg"


10

Le mie connessioni SSH hanno funzionato bene, ma dall'ultima settimana SSH dal mio laptop alla mia scheda ha rifiutato la connessione. Posso stabilire una connessione SSH dalla scheda al laptop, ma non viceversa. L'ho provato con il mio utente e utente root e ho avuto lo stesso problema.

Il mio laptop è un Ubuntu 12.10 e la mia scheda è un Debian 6.

Ecco l'output dettagliato di SSH:

danialbehzadi @ danial-HP: ~ $ ssh -v 192.168.1.2  
OpenSSH_5.2p1, OpenSSL 1.0.1c 10 maggio 2012
debug1: lettura dei dati di configurazione / usr / local / etc / ssh_config
debug1: connessione alla porta 22.1 192.168.1.2 [192.168.1.2].
debug1: connessione stabilita.  
debug1: file di identità /home/danialbehzadi/.ssh/identity type -1  
debug1: file di identità /home/danialbehzadi/.ssh/id_rsa tipo 1  
debug1: file di identità /home/danialbehzadi/.ssh/id_dsa tipo -1  
debug1: Protocollo remoto versione 2.0, versione del software remoto OpenSSH_6.0p1 Debian-4  
debug1: match: OpenSSH_6.0p1 Debian-4 pat OpenSSH *  
debug1: abilitazione della modalità di compatibilità per il protocollo 2.0  
debug1: stringa di versione locale SSH-2.0-OpenSSH_5.2  
debug1: SSH2_MSG_KEXINIT inviato  
debug1: SSH2_MSG_KEXINIT ricevuto  
debug1: kex: server-> client aes128-ctr hmac-md5 nessuno  
debug1: kex: client-> server aes128-ctr hmac-md5 nessuno  
nessuna hostkey alg

Risposte:


8

Ho creato nuove chiavi rsa e dsa sulla scheda ed è andato tutto bene:

~# ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key
~# ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key

In una nota correlata, quando ho provato a connettermi da dropbear ssh (comune su Android) a cygwin's sshd, ho ottenuto "nessuna corrispondenza algo hostkey". Il server è stato impostato per accettare la chiave e la password, quindi avrebbe dovuto passare alla password se la chiave ha esito negativo. Quindi penso che questa soluzione potrebbe non funzionare per alcuni .. Secondo questo link ha a che fare con l'algoritmo di crittografia utilizzato linksysinfo.org/index.php?threads/tomato-ssh.29460 ma nessuna soluzione menzionata lì.
barlop,

1
Abbiamo avuto lo stesso problema con un server Ubuntu 14.04. Dopo aver provato ad avviare una nuova istanza del server SSH in modalità debug, abbiamo scoperto che le chiavi private sul server non avevano l'autorizzazione 0600, una volta risolto il problema e riavviato il server, tutto ha iniziato a funzionare correttamente.
Awi,

-1

[root @ server ~] # ls -la / etc / ssh / ssh_host_ *

-rw-------. 1 root root      668 Jun 25 00:03 /etc/ssh/ssh_host_dsa_key
-rw-r--r--. 1 root root      609 Jun 25 00:03 /etc/ssh/ssh_host_dsa_key.pub
-rw-r-----. 1 root ssh_keys  227 Dec 14  2018 /etc/ssh/ssh_host_ecdsa_key
-rw-r--r--. 1 root root      162 Dec 14  2018 /etc/ssh/ssh_host_ecdsa_key.pub
-rw-r-----. 1 root ssh_keys  387 Dec 14  2018 /etc/ssh/ssh_host_ed25519_key
-rw-r--r--. 1 root root       82 Dec 14  2018 /etc/ssh/ssh_host_ed25519_key.pub
-rw-------. 1 root root      963 Apr 18  2011 /etc/ssh/ssh_host_key
-rw-r--r--. 1 root root      627 Apr 18  2011 /etc/ssh/ssh_host_key.pub
-rw-------. 1 root root     1679 Jun 25 00:02 /etc/ssh/ssh_host_rsa_key
-rw-r--r--. 1 root root      401 Jun 25 00:02 /etc/ssh/ssh_host_rsa_key.pub

assicurarsi che la modalità file ssh_host_ * sia 644 e 600 come questa

Utilizzando il nostro sito, riconosci di aver letto e compreso le nostre Informativa sui cookie e Informativa sulla privacy.
Licensed under cc by-sa 3.0 with attribution required.