<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
p.xmsonormal, li.xmsonormal, div.xmsonormal
{mso-style-name:x_msonormal;
margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
p.xmsochpdefault, li.xmsochpdefault, div.xmsochpdefault
{mso-style-name:x_msochpdefault;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.xmsohyperlink
{mso-style-name:x_msohyperlink;
color:#0563C1;
text-decoration:underline;}
span.xmsohyperlinkfollowed
{mso-style-name:x_msohyperlinkfollowed;
color:#954F72;
text-decoration:underline;}
span.xemailstyle17
{mso-style-name:x_emailstyle17;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle24
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Hi Hans,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I tried it with several OTP releases up to 21. I have not tried OTP 22.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Here is what I received with telnet:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">QþCb8é¢ê˜x|qâob‚gss-group1-sha1-toWM5Slw5Ew8Mqkay+al2g==,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1ssh-rsa,ssh-dss aes256-cbc,aes192-cbc,aes128-cbc aes256-cbc,aes192-cbc,aes128-cbchmac-sha1-96,hmac-md5-96hmac-sha1-96,hmac-md5-96
none,zlib none,zlib<o:p></o:p></p>
<p class="MsoNormal"> es,i-default<o:p></o:p></p>
<p class="MsoNormal"> es,i-defaultConnection closed by foreign host.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">And these are the default algorithms:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">[{kex,['ecdh-sha2-nistp384','ecdh-sha2-nistp521',<o:p></o:p></p>
<p class="MsoNormal"> 'ecdh-sha2-nistp256','diffie-hellman-group-exchange-sha256',<o:p></o:p></p>
<p class="MsoNormal"> 'diffie-hellman-group16-sha512',<o:p></o:p></p>
<p class="MsoNormal"> 'diffie-hellman-group18-sha512',<o:p></o:p></p>
<p class="MsoNormal"> 'diffie-hellman-group14-sha256',<o:p></o:p></p>
<p class="MsoNormal"> 'diffie-hellman-group14-sha1',<o:p></o:p></p>
<p class="MsoNormal"> 'diffie-hellman-group-exchange-sha1']},<o:p></o:p></p>
<p class="MsoNormal">{public_key,['ecdsa-sha2-nistp384','ecdsa-sha2-nistp521',<o:p></o:p></p>
<p class="MsoNormal"> 'ecdsa-sha2-nistp256','ssh-rsa','rsa-sha2-256',<o:p></o:p></p>
<p class="MsoNormal"> 'rsa-sha2-512','ssh-dss']},<o:p></o:p></p>
<p class="MsoNormal">{cipher,[{client2server,['aes256-gcm@openssh.com',<o:p></o:p></p>
<p class="MsoNormal"> 'aes256-ctr','aes192-ctr','aes128-gcm@openssh.com',<o:p></o:p></p>
<p class="MsoNormal"> 'aes128-ctr','aes128-cbc','3des-cbc']},<o:p></o:p></p>
<p class="MsoNormal"> {server2client,['aes256-gcm@openssh.com','aes256-ctr',<o:p></o:p></p>
<p class="MsoNormal"> 'aes192-ctr','aes128-gcm@openssh.com','aes128-ctr',<o:p></o:p></p>
<p class="MsoNormal"> 'aes128-cbc','3des-cbc']}]},<o:p></o:p></p>
<p class="MsoNormal">{mac,[{client2server,['hmac-sha2-256','hmac-sha2-512',<o:p></o:p></p>
<p class="MsoNormal"> 'hmac-sha1']},<o:p></o:p></p>
<p class="MsoNormal"> {server2client,['hmac-sha2-256','hmac-sha2-512',<o:p></o:p></p>
<p class="MsoNormal"> 'hmac-sha1']}]},<o:p></o:p></p>
<p class="MsoNormal">{compression,[{client2server,[none,'zlib@openssh.com',zlib]},<o:p></o:p></p>
<p class="MsoNormal"> {server2client,[none,'zlib@openssh.com',zlib]}]}]<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">5> ssh_transport:supported_algorithms(mac).<o:p></o:p></p>
<p class="MsoNormal">[{client2server,['hmac-sha2-256','hmac-sha2-512',<o:p></o:p></p>
<p class="MsoNormal"> 'hmac-sha1','AEAD_AES_128_GCM','AEAD_AES_256_GCM']},<o:p></o:p></p>
<p class="MsoNormal">{server2client,['hmac-sha2-256','hmac-sha2-512','hmac-sha1',<o:p></o:p></p>
<p class="MsoNormal"> 'AEAD_AES_128_GCM','AEAD_AES_256_GCM']}]<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
<p class="MsoNormal">Jozsef<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Hans Nilsson R <hans.r.nilsson@ericsson.com> <br>
<b>Sent:</b> Tuesday, 8 October, 2019 10:47<br>
<b>To:</b> József Bérces <jozsef.berces@ericsson.com>; Erlang Questions <erlang-questions@erlang.org><br>
<b>Subject:</b> Sv: ssh:connect "Key exchange failed"<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:black">The "Key exchange failed" error indicates that there is no agreement in the first phase where different algorithms are negotiated.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:black">A common cause is that there are no common cipher algorithm available. For example the AES-256 CBC is not available in Erlang SSH.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:black">Which otp version do you use?<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:black">What does the function ssh:default_algorithms() return?<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:black">What algorithms does the server provide? (Check by telnet the server, type "SSH-2.0-xxx" and look at the funny characters that is returned. Or post them here)<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:black">/Hans
<o:p></o:p></span></p>
</div>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="2" width="98%" align="center">
</div>
<div id="divRplyFwdMsg">
<p class="MsoNormal"><b><span style="color:black">Från:</span></b><span style="color:black"> erlang-questions-bounces@erlang.org <erlang-questions-bounces@erlang.org> för József Bérces <jozsef.berces@ericsson.com><br>
<b>Skickat:</b> den 8 oktober 2019 09:23<br>
<b>Till:</b> Erlang Questions <erlang-questions@erlang.org><br>
<b>Ämne:</b> [erlang-questions] ssh:connect "Key exchange failed"</span> <o:p></o:p></p>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="xmsonormal">Hi,<o:p></o:p></p>
<p class="xmsonormal"> <o:p></o:p></p>
<p class="xmsonormal">I need to connect to an ssh server but ssh:connect always returns "Key exchange failed". I can connect with KiTTY, and checking the KiTTY logs I suspect that the problem is the 1024-bit RSA key.
<o:p></o:p></p>
<p class="xmsonormal"> <o:p></o:p></p>
<p class="xmsonormal">Could you please check the KiTTY log below what is not supported by the Erlang SSH client?
<o:p></o:p></p>
<p class="xmsonormal"> <o:p></o:p></p>
<p class="xmsonormal">Is there any way to add the missing support to the Erlang SSH client so that I could connect to this server?<o:p></o:p></p>
<p class="xmsonormal"> <o:p></o:p></p>
<p class="xmsonormal">Thanks,<o:p></o:p></p>
<p class="xmsonormal">Jozsef<o:p></o:p></p>
<p class="xmsonormal"> <o:p></o:p></p>
<p class="xmsonormal">2019-10-07 14:37:58 Starting 42264 from XXXXX@XXXXXX<o:p></o:p></p>
<p class="xmsonormal">2019-10-07 14:38:07 Connecting to 10.XXX.XXX.XXX port 22<o:p></o:p></p>
<p class="xmsonormal">2019-10-07 14:38:07 We claim version: SSH-2.0-PuTTY_KiTTY<o:p></o:p></p>
<p class="xmsonormal">2019-10-07 14:38:07 Server version: SSH-2.0-Sun_SSH_1.1.5<o:p></o:p></p>
<p class="xmsonormal">2019-10-07 14:38:07 Using SSH protocol version 2<o:p></o:p></p>
<p class="xmsonormal">2019-10-07 14:38:08 Doing Diffie-Hellman group exchange<o:p></o:p></p>
<p class="xmsonormal">2019-10-07 14:38:08 Doing Diffie-Hellman key exchange with hash SHA-1<o:p></o:p></p>
<p class="xmsonormal">2019-10-07 14:38:08 Server also has ssh-dss host key, but we don't know it<o:p></o:p></p>
<p class="xmsonormal">2019-10-07 14:38:08 Host key fingerprint is:<o:p></o:p></p>
<p class="xmsonormal">2019-10-07 14:38:08 ssh-rsa 1024 XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX<o:p></o:p></p>
<p class="xmsonormal">2019-10-07 14:38:16 Initialised AES-256 CBC client->server encryption<o:p></o:p></p>
<p class="xmsonormal">2019-10-07 14:38:16 Initialised HMAC-SHA1-96 client->server MAC algorithm<o:p></o:p></p>
<p class="xmsonormal">2019-10-07 14:38:16 Initialised AES-256 CBC server->client encryption<o:p></o:p></p>
<p class="xmsonormal">2019-10-07 14:38:16 Initialised HMAC-SHA1-96 server->client MAC algorithm<o:p></o:p></p>
<p class="xmsonormal">2019-10-07 14:38:22 Using SSPI from SECUR32.DLL<o:p></o:p></p>
<p class="xmsonormal">2019-10-07 14:38:22 Attempting GSSAPI authentication<o:p></o:p></p>
<p class="xmsonormal">2019-10-07 14:38:22 GSSAPI authentication initialisation failed<o:p></o:p></p>
<p class="xmsonormal">2019-10-07 14:38:22 The target was not recognized.<o:p></o:p></p>
<p class="xmsonormal">2019-10-07 14:38:22 Attempting keyboard-interactive authentication<o:p></o:p></p>
<p class="xmsonormal">2019-10-07 14:38:30 Access granted<o:p></o:p></p>
<p class="xmsonormal">2019-10-07 14:38:30 Opening session as main channel<o:p></o:p></p>
<p class="xmsonormal">2019-10-07 14:38:30 Opened main channel<o:p></o:p></p>
<p class="xmsonormal">2019-10-07 14:38:30 Allocated pty (ospeed 38400bps, ispeed 38400bps)<o:p></o:p></p>
<p class="xmsonormal">2019-10-07 14:38:31 Started a shell/command<o:p></o:p></p>
</div>
</div>
</div>
</body>
</html>