<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hello, I've some strange problem, when I run ssh server and try to connect to it from code on the same machine I've got an error:<div><br></div><div>Selection of key exchange algorithm failed</div><div><br></div><div>Server:</div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">ssh:daemon(Port, [{system_dir,            "/etc/ssh"},<br>                              {subsystems,           [wm_ssh_sftp_ext:subsystem_spec(),<br>                                                               ssh_sftpd:subsystem_spec([{cwd, _CWD = "/"}])]},  <br>                              {user_passwords,    [{"user", "pass"}]}]).</blockquote><div><br></div><div>Client:</div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Opts = [{user, "user"},<br>             {password, "pass"},<br>             {silently_accept_hosts, true}],<br>ssh:connect(Node, Port, Opts, _Timeout = 5000).</blockquote><div><br></div><div>When I capture ssh traffic I find out that the server doesn't suggest `host_key_algorithms`<br><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">                kex_algorithms length: 257<br>                kex_algorithms string [truncated]: ecdh-sha2-nistp384,ecdh-sha2-nistp521,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-grou<br>                server_host_key_algorithms length: 0<br>                server_host_key_algorithms string: [Empty]<br>                encryption_algorithms_client_to_server length: 98<br>                encryption_algorithms_client_to_server string: <a href="mailto:aes256-gcm@openssh.com">aes256-gcm@openssh.com</a>,aes256-ctr,aes192-ctr,<a href="mailto:aes128-gcm@openssh.com">aes128-gcm@openssh.com</a>,aes128-ctr,aes128-cbc,3des-cbc<br>                encryption_algorithms_server_to_client length: 98<br>                encryption_algorithms_server_to_client string: <a href="mailto:aes256-gcm@openssh.com">aes256-gcm@openssh.com</a>,aes256-ctr,aes192-ctr,<a href="mailto:aes128-gcm@openssh.com">aes128-gcm@openssh.com</a>,aes128-ctr,aes128-cbc,3des-cbc<br>                mac_algorithms_client_to_server length: 37<br>                mac_algorithms_client_to_server string: hmac-sha2-256,hmac-sha2-512,hmac-sha1<br>                mac_algorithms_server_to_client length: 37<br>                mac_algorithms_server_to_client string: hmac-sha2-256,hmac-sha2-512,hmac-sha1<br>                compression_algorithms_client_to_server length: 26<br>                compression_algorithms_client_to_server string: none,<a href="mailto:zlib@openssh.com">zlib@openssh.com</a>,zlib<br>                compression_algorithms_server_to_client length: 26<br>                compression_algorithms_server_to_client string: none,<a href="mailto:zlib@openssh.com">zlib@openssh.com</a>,zlib<br>                languages_client_to_server length: 0<br>                languages_client_to_server string: [Empty]<br>                languages_server_to_client length: 0<br>                languages_server_to_client string: [Empty]<br>                First KEX Packet Follows: 0<br>                Reserved: 00000000<br>            Padding String: 21850013139a828f718a</blockquote></div></div><div><br></div><div>But the client has some values:</div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">                kex_algorithms length: 257<br>                kex_algorithms string [truncated]: ecdh-sha2-nistp384,ecdh-sha2-nistp521,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-grou<br>                server_host_key_algorithms length: 101<br>                server_host_key_algorithms string: ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ecdsa-sha2-nistp256,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss<br>                encryption_algorithms_client_to_server length: 98<br>                encryption_algorithms_client_to_server string: <a href="mailto:aes256-gcm@openssh.com">aes256-gcm@openssh.com</a>,aes256-ctr,aes192-ctr,<a href="mailto:aes128-gcm@openssh.com">aes128-gcm@openssh.com</a>,aes128-ctr,aes128-cbc,3des-cbc<br>                encryption_algorithms_server_to_client length: 98<br>                encryption_algorithms_server_to_client string: <a href="mailto:aes256-gcm@openssh.com">aes256-gcm@openssh.com</a>,aes256-ctr,aes192-ctr,<a href="mailto:aes128-gcm@openssh.com">aes128-gcm@openssh.com</a>,aes128-ctr,aes128-cbc,3des-cbc<br>                mac_algorithms_client_to_server length: 37<br>                mac_algorithms_client_to_server string: hmac-sha2-256,hmac-sha2-512,hmac-sha1<br>                mac_algorithms_server_to_client length: 37<br>                mac_algorithms_server_to_client string: hmac-sha2-256,hmac-sha2-512,hmac-sha1<br>                compression_algorithms_client_to_server length: 26<br>                compression_algorithms_client_to_server string: none,<a href="mailto:zlib@openssh.com">zlib@openssh.com</a>,zlib<br>                compression_algorithms_server_to_client length: 26<br>                compression_algorithms_server_to_client string: none,<a href="mailto:zlib@openssh.com">zlib@openssh.com</a>,zlib<br>                languages_client_to_server length: 0<br>                languages_client_to_server string: [Empty]<br>                languages_server_to_client length: 0<br>                languages_server_to_client string: [Empty]<br>                First KEX Packet Follows: 0<br>                Reserved: 00000000<br>            Padding String: 49945334a432cfa4a0371700f6</blockquote></div><div><br></div><div>Could someone help me please resolve this problem?</div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr">Петровский Александр / Alexander Petrovsky,<br><br>Skype: askjuise<br><div>Phone: +7 931 9877991<div><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div>