<div dir="ltr"><div><div>I followed the code here (<a href="https://github.com/erlang/otp/blob/OTP-17.0.2/lib/ssh/src/ssh_transport.erl#L374">https://github.com/erlang/otp/blob/OTP-17.0.2/lib/ssh/src/ssh_transport.erl#L374</a>)<br>
<br></div>It tells me that the client and server share no host key algorithm. Did you setup a host key(s) for the server?<br><br></div>I think the code should crash at line 374 instead of returning undefined and crashing in a more obscure place, but perhaps there are other reasons for that.<br>
<div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jun 12, 2014 at 10:03 AM, Mario Santoro <span dir="ltr"><<a href="mailto:mario.santoro@ericsson.com" target="_blank">mario.santoro@ericsson.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div link="blue" vlink="purple" lang="EN-US">
<div>
<p class="MsoNormal">Hi,<u></u><u></u></p>
<p class="MsoNormal">I’m trying to run an SSH server in Erlang and test a <user/password> connection over SSH.<u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#222222;background:white">I’ve generated an RSA keys pair (with NO passphrase) for the SSH system and put the private key into “C:/Utility/Putty/ssh_daemon” directory,
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#222222;background:white">while the user public_key is into “C:/Utility/Putty/public_key” directory.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#222222;background:white">I’m running both the server and the client on the same PC, into two different Erlang nodes.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#222222;background:white"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#222222;background:white">The SSH server starts fine:<u></u><u></u></span></p>
<p class="MsoNormal"><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#222222;background:white">(</span></i><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red;background:white">node1@E7E4115BF83167)1> ssh:start().<u></u><u></u></span></i></p>
<p class="MsoNormal"><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red;background:white">ok<u></u><u></u></span></i></p>
<p class="MsoNormal"><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red;background:white">(node1@E7E4115BF83167)2> {ok, Sshd} = ssh:daemon(8988, [{auth_methods, "password"}, {user_passwords, [{"mario", "mariopasswd"}, {system_dir, "C:/Utility/Putty/ssh_daemon"}]}
]).<u></u><u></u></span></i></p>
<p class="MsoNormal"><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red;background:white">{ok,<0.54.0>}<u></u><u></u></span></i></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#222222;background:white"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#222222;background:white"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#222222;background:white">but on receiving a connection from the client:<u></u><u></u></span></p>
<p class="MsoNormal"><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#0070c0;background:white">(node2@E7E4115BF83167)1> ssh:start().<u></u><u></u></span></i></p>
<p class="MsoNormal"><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#0070c0;background:white">ok<u></u><u></u></span></i></p>
<p class="MsoNormal"><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#0070c0;background:white">(node2@E7E4115BF83167)2> {ok, ConnectionRef} = ssh:connect("E7E4115BF83167", 8988, [{user, "mario"}, {password, "mariopasswd"}, {user_dir,
"C:/Utility/Putty/public_key"}, {silently_accept_hosts, true}, {user_interaction, false} ], 5000).<u></u><u></u></span></i></p>
<p class="MsoNormal"><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#0070c0;background:white">** exception error: no match of right hand side value {error,"Internal error"}<u></u><u></u></span></i></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#222222;background:white"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#222222;background:white"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#222222;background:white">the SSH server application is crashing with the following error<span>:</span></span><span><u></u><u></u></span></p>
<p class="MsoNormal"><span><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red;background:white">(node1@E7E4115BF83167)3>
<u></u><u></u></span></i></span></p>
<p class="MsoNormal"><span><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red;background:white">=ERROR REPORT==== 29-May-2014::17:44:58 ===<u></u><u></u></span></i></span></p>
<p class="MsoNormal"><span><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red;background:white">Erlang ssh connection handler failed with reason: function_clause
<u></u><u></u></span></i></span></p>
<p class="MsoNormal"><span><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red;background:white">, Stacktace: [{ssh_file,identity_pass_phrase,<u></u><u></u></span></i></span></p>
<p class="MsoNormal"><span><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red;background:white"> [undefined],<u></u><u></u></span></i></span></p>
<p class="MsoNormal"><span><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red;background:white"> [{file,"ssh_file.erl"},{line,222}]},<u></u><u></u></span></i></span></p>
<p class="MsoNormal"><span><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red;background:white"> {ssh_file,host_key,2,[{file,"ssh_file.erl"},{line,53}]},<u></u><u></u></span></i></span></p>
<p class="MsoNormal"><span><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red;background:white"> {ssh_transport,get_host_key,1,<u></u><u></u></span></i></span></p>
<p class="MsoNormal"><span><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red;background:white"> [{file,"ssh_transport.erl"},{line,412}]},<u></u><u></u></span></i></span></p>
<p class="MsoNormal"><span><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red;background:white"> {ssh_transport,handle_kexdh_init,2,<u></u><u></u></span></i></span></p>
<p class="MsoNormal"><span><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red;background:white"> [{file,"ssh_transport.erl"},{line,314}]},<u></u><u></u></span></i></span></p>
<p class="MsoNormal"><span><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red;background:white"> {ssh_connection_handler,key_exchange,2,<u></u><u></u></span></i></span></p>
<p class="MsoNormal"><span><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red;background:white"> [{file,"ssh_connection_handler.erl"},<u></u><u></u></span></i></span></p>
<p class="MsoNormal"><span><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red;background:white"> {line,201}]},<u></u><u></u></span></i></span></p>
<p class="MsoNormal"><span><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red;background:white"> {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,494}]},<u></u><u></u></span></i></span></p>
<p class="MsoNormal"><span><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red;background:white"> {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]
<u></u><u></u></span></i></span></p>
<p class="MsoNormal"><span><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red;background:white">please report this to <a href="mailto:erlang-bugs@erlang.org" target="_blank">erlang-bugs@erlang.org</a><u></u><u></u></span></i></span></p>
<p class="MsoNormal"><span><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#222222;background:white"><u></u> <u></u></span></span></p>
<p class="MsoNormal"><span><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#222222;background:white"><u></u> <u></u></span></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#222222;background:white">This happens at each client connection attempt.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#222222;background:white">Could you please help me on this issue?</span><span><u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thank you in advance for your help.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Regards,<u></u><u></u></p>
<p class="MsoNormal">/Mario<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal" style="text-autospace:none"><img src="cid:image001.gif@01CF7B66.8C8F0EA0" alt="cid:image001.gif@01CF7B66.8C8F0EA0" height="3" width="255"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"" lang="IT"><br>
<br>
<b><span style="color:#333333">MARIO SANTORO </span></b></span><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:#333333" lang="IT"> <br>
</span><b><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#333333" lang="IT">CD Media & Application</span></b><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:#333333" lang="IT">
<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:#333333" lang="IT"><br>
</span><span style="font-size:9.0pt;font-family:"Arial","sans-serif";color:#333333" lang="IT">Ericsson Telecomunicazioni SpA<br>
SCM Region<br>
Via Anagnina, 203<br>
00118, Rome, ITALY<br>
Phone <a href="tel:%2B39%2006%207258%208404" value="+390672588404" target="_blank">+39 06 7258 8404</a><br>
Fax <a href="tel:%2B39%2006%207258%204289" value="+390672584289" target="_blank">+39 06 7258 4289</a><br>
Mobile <a href="tel:%2B39%20335%20699%205215" value="+393356995215" target="_blank">+39 335 699 5215</a><br>
<a href="mailto:mario.santoro@ericsson.com" target="_blank">mario.santoro@ericsson.com</a><br>
<a href="http://www.ericsson.com" target="_blank">www.ericsson.com</a> </span><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:#333333" lang="IT"> <u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:#333333" lang="IT"><br>
<br>
</span><a href="http://www.ericsson.com/" target="_blank"><span style="color:windowtext;text-decoration:none"><img src="cid:image002.png@01CF7B66.8C8F0EA0" alt="cid:image002.png@01CF7B66.8C8F0EA0" border="0" height="81" width="500"></span></a><span style="font-size:9.0pt;font-family:"Arial","sans-serif""> </span><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> <u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""><br>
</span><span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:#333333">This Communication is Confidential. We only send and receive email on the basis of the terms set out at
</span><span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:#333333" lang="IT"><a href="http://www.ericsson.com/email_disclaimer" target="_blank"><span style="color:#333333" lang="EN-US">www.ericsson.com/email_disclaimer</span></a>
</span><span style="font-size:12.0pt;font-family:"Times New Roman","serif"" lang="IT"> </span><span style="font-size:12.0pt;font-family:"Times New Roman","serif""><u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<br>_______________________________________________<br>
erlang-bugs mailing list<br>
<a href="mailto:erlang-bugs@erlang.org">erlang-bugs@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-bugs" target="_blank">http://erlang.org/mailman/listinfo/erlang-bugs</a><br>
<br></blockquote></div><br></div>