Während Sie ssh von einem lokalen Host zu einem Remote-Host ausführen, die sich auf verschiedenen Versionen von ssh befinden, ist es möglich, dass Sie die Meldung „Algorithmus-Aushandlung fehlgeschlagen“ erhalten. In diesem Beitrag erkläre ich, wie Sie dieses Problem vom SSH-Client aus lösen können.
1. SSH-Verbindung zum Remote-Host nicht möglich :In diesem Beispiel erhalten wir beim Versuch, ssh vom lokalen Host zum Remote-Host auszuführen, die Fehlermeldung „Algorithm negotiation failed“, wie unten gezeigt. Bitte beachten Sie, dass der lokale Host den ssh2-Client ausführt.
[local-host]$ ssh -l jsmith remote-host warning: Authentication failed. Disconnected; key exchange or algorithm negotiation failed (Algorithm negotiation failed.). [local-host]$ ssh -V ssh: SSH Secure Shell 3.2.9.1 (non-commercial version) on i686-pc-linux-gnu [local-host]$ ls -l /usr/local/bin/ssh lrwxrwxrwx 1 root root 4 Mar 10 22:04 /usr/local/bin/ssh -> ssh2
2. Erhalten Sie weitere Debug-Informationen zur Fehlermeldung von SSH . Übergeben Sie den Parameter -v an den ssh-Client, um zusätzliche Debug-Informationen anzuzeigen, die bei der weiteren Fehlerbehebung dieses Problems helfen, wie unten gezeigt.
[local-host]$ ssh -v -l jsmith remote-host debug: SshConfig/sshconfig.c:2838/ssh2_parse_config_ext: Metaconfig parsing stopped at line 3. debug: SshConfig/sshconfig.c:637/ssh_config_set_param_verbose: Setting variable 'VerboseMode' to 'FALSE'. debug: SshConfig/sshconfig.c:3130/ssh_config_read_file_ext: Read 17 params from config file. debug: Ssh2/ssh2.c:1707/main: User config file not found, using defaults. (Looked for '/home/jsmith/.ssh2/ssh2_config') debug: Connecting to 192.168.101.107, port 22... (SOCKS not used) debug: Ssh2Transport/trcommon.c:3676/ssh_tr_create: My version: SSH-1.99-3.2.9.1 SSH Secure Shell (non-commercial) debug: client supports 2 auth methods: 'publickey,password' debug: Ssh2Common/sshcommon.c:537/ssh_common_wrap: local ip = 192.168.1.2, local port = 59514 debug: Ssh2Common/sshcommon.c:539/ssh_common_wrap: remote ip = 192.168.1.3, remote port = 22 debug: SshConnection/sshconn.c:1945/ssh_conn_wrap: Wrapping... debug: SshReadLine/sshreadline.c:2427/ssh_readline_eloop_initialize: Initializing ReadLine... debug: Remote version: SSH-2.0-OpenSSH_5.0 debug: OpenSSH: Major: 5 Minor: 0 Revision: 0 debug: Ssh2Transport/trcommon.c:973/ssh_tr_input_version: All versions of OpenSSH handle kex guesses incorrectly. debug: Ssh2Transport/trcommon.c:1116/ssh_tr_negotiate_one_alg: Algorithm negotiation failed for c_to_s_compr: client list: zlib vs. server list : none,[email protected] debug: Ssh2Transport/trcommon.c:1116/ssh_tr_negotiate_one_alg: Algorithm negotiation failed for s_to_c_compr: client list: zlib vs. server list : none,[email protected] debug: Ssh2Transport/trcommon.c:1367/ssh_tr_negotiate: lang s to c: `', lang c to s: `' debug: Ssh2Common/sshcommon.c:169/ssh_common_disconnect: DISCONNECT received: Algorithm negotiation failed. debug: SshReadLine/sshreadline.c:2485/ssh_readline_eloop_uninitialize: Uninitializing ReadLine... warning: Authentication failed. Disconnected; key exchange or algorithm negotiation failed (Algorithm negotiation failed.). debug: Ssh2Common/sshcommon.c:662/ssh_common_destroy: Destroying SshCommon object. debug: SshConnection/sshconn.c:1997/ssh_conn_destroy: Destroying SshConn object.
Basierend auf dieser Debug-Informationsmeldung, die in der Debug-Meldung angezeigt wird:„Algorithm negotiation failed for s_to_c_compr:client list:zlib vs. server list :none,[email protected] “, ist es sehr klar, dass der Client (lokaler Host) die zlib-Komprimierung verwendet und der Server (Remote-Host) zlib nicht verwendet.
3. Beheben Sie das Problem, indem Sie ohne Komprimierung eine SSH-Verbindung zum Remote-Host herstellen. Übergeben Sie das -o „Compression no“ an den ssh-Client, um das Problem zu lösen, wie unten gezeigt.
[local-host]$ ssh -o "Compression no" -l jsmith remote-host jsmith@remote-host's password: Last login: Wed Jun 25 17:06:31 2008 from 192.168.1.2 [remote-host]$ ssh -V OpenSSH_5.0p1, OpenSSL 0.9.8g 19 Oct 2007
Jetzt, da Sie nach dem Passieren des -o „Compression no“ ohne Probleme verbunden sind Parameter an den ssh-Client, können Sie feststellen, dass der Remote-Host openSSH verwendet, das sich von dem ssh unterscheidet, das auf dem lokalen Host ausgeführt wurde, was der Grund für das Problem der Algorithmus-Aushandlung war.