
Al realizar ssh desde un host local a un host remoto que se encuentran en diferentes versiones de ssh, es posible que reciba el mensaje "Error en la negociación del algoritmo". En esta publicación, explicaré cómo resolver este problema desde el cliente ssh.
[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
[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.
Basado en este mensaje de información de depuración que se muestra en el mensaje de depuración:“La negociación del algoritmo falló para s_to_c_compr:lista de clientes:zlib vs. lista de servidores:ninguno,[email protected] “, está muy claro que el cliente (host local) está usando la compresión zlib y el servidor (host remoto) no está usando zlib.
[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
Ahora que está conectado sin ningún problema después de pasar la -o "Compresión no" parámetro al cliente ssh, puede notar que el host remoto está usando openSSH, que es diferente al ssh que se estaba ejecutando en el host local, que fue la razón por la que falló la negociación del algoritmo.