<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=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (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:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
span.EmailStyle19
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.apple-converted-space
        {mso-style-name:apple-converted-space;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
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="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal">I’m trying to run an SSH server in Erlang and test a <user/password> connection over SSH.<o:p></o:p></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,
<o:p></o:p></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.<o:p></o:p></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.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#222222;background:white"><o:p> </o:p></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:<o:p></o:p></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().<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red;background:white">ok<o:p></o:p></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"}]}
 ]).<o:p></o:p></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>}<o:p></o:p></span></i></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#222222;background:white"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#222222;background:white"><o:p> </o:p></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:<o:p></o:p></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().<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#0070C0;background:white">ok<o:p></o:p></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).<o:p></o:p></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"}<o:p></o:p></span></i></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#222222;background:white"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#222222;background:white"><o:p> </o:p></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 class="apple-converted-space">:</span></span><span class="apple-converted-space"><o:p></o:p></span></p>
<p class="MsoNormal"><span class="apple-converted-space"><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red;background:white">(node1@E7E4115BF83167)3>
<o:p></o:p></span></i></span></p>
<p class="MsoNormal"><span class="apple-converted-space"><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red;background:white">=ERROR REPORT==== 29-May-2014::17:44:58 ===<o:p></o:p></span></i></span></p>
<p class="MsoNormal"><span class="apple-converted-space"><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
<o:p></o:p></span></i></span></p>
<p class="MsoNormal"><span class="apple-converted-space"><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red;background:white">, Stacktace: [{ssh_file,identity_pass_phrase,<o:p></o:p></span></i></span></p>
<p class="MsoNormal"><span class="apple-converted-space"><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red;background:white">                        [undefined],<o:p></o:p></span></i></span></p>
<p class="MsoNormal"><span class="apple-converted-space"><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red;background:white">                        [{file,"ssh_file.erl"},{line,222}]},<o:p></o:p></span></i></span></p>
<p class="MsoNormal"><span class="apple-converted-space"><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}]},<o:p></o:p></span></i></span></p>
<p class="MsoNormal"><span class="apple-converted-space"><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red;background:white">              {ssh_transport,get_host_key,1,<o:p></o:p></span></i></span></p>
<p class="MsoNormal"><span class="apple-converted-space"><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red;background:white">                             [{file,"ssh_transport.erl"},{line,412}]},<o:p></o:p></span></i></span></p>
<p class="MsoNormal"><span class="apple-converted-space"><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red;background:white">              {ssh_transport,handle_kexdh_init,2,<o:p></o:p></span></i></span></p>
<p class="MsoNormal"><span class="apple-converted-space"><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red;background:white">                             [{file,"ssh_transport.erl"},{line,314}]},<o:p></o:p></span></i></span></p>
<p class="MsoNormal"><span class="apple-converted-space"><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red;background:white">              {ssh_connection_handler,key_exchange,2,<o:p></o:p></span></i></span></p>
<p class="MsoNormal"><span class="apple-converted-space"><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red;background:white">                                      [{file,"ssh_connection_handler.erl"},<o:p></o:p></span></i></span></p>
<p class="MsoNormal"><span class="apple-converted-space"><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red;background:white">                                       {line,201}]},<o:p></o:p></span></i></span></p>
<p class="MsoNormal"><span class="apple-converted-space"><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}]},<o:p></o:p></span></i></span></p>
<p class="MsoNormal"><span class="apple-converted-space"><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}]}]
<o:p></o:p></span></i></span></p>
<p class="MsoNormal"><span class="apple-converted-space"><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red;background:white">please report this to erlang-bugs@erlang.org<o:p></o:p></span></i></span></p>
<p class="MsoNormal"><span class="apple-converted-space"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#222222;background:white"><o:p> </o:p></span></span></p>
<p class="MsoNormal"><span class="apple-converted-space"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#222222;background:white"><o:p> </o:p></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><o:p></o:p></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 class="apple-converted-space"><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thank you in advance for your help.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Regards,<o:p></o:p></p>
<p class="MsoNormal">/Mario<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="text-autospace:none"><img width="255" height="3" id="Picture_x0020_1" src="cid:image001.gif@01CF7B66.8C8F0EA0" alt="cid:image001.gif@01CF7B66.8C8F0EA0"><span lang="IT" style="font-size:10.0pt;font-family:"Arial","sans-serif""><br>
<br>
<b><span style="color:#333333">MARIO SANTORO </span></b></span><span lang="IT" style="font-size:12.0pt;font-family:"Times New Roman","serif";color:#333333"> <br>
</span><b><span lang="IT" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#333333">CD Media & Application</span></b><span lang="IT" style="font-size:12.0pt;font-family:"Times New Roman","serif";color:#333333">
<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="IT" style="font-size:12.0pt;font-family:"Times New Roman","serif";color:#333333"><br>
</span><span lang="IT" style="font-size:9.0pt;font-family:"Arial","sans-serif";color:#333333">Ericsson Telecomunicazioni SpA<br>
SCM Region<br>
Via Anagnina, 203<br>
00118, Rome, ITALY<br>
Phone +39 06 7258 8404<br>
Fax +39 06 7258 4289<br>
Mobile +39 335 699 5215<br>
<a href="mailto:mario.santoro@ericsson.com">mario.santoro@ericsson.com</a><br>
<a href="www.ericsson.com">www.ericsson.com</a> </span><span lang="IT" style="font-size:12.0pt;font-family:"Times New Roman","serif";color:#333333"> <o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="IT" style="font-size:12.0pt;font-family:"Times New Roman","serif";color:#333333"><br>
<br>
</span><a href="http://www.ericsson.com/"><span style="color:windowtext;text-decoration:none"><img border="0" width="500" height="81" id="Picture_x0020_2" src="cid:image002.png@01CF7B66.8C8F0EA0" alt="cid:image002.png@01CF7B66.8C8F0EA0"></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""> <o:p></o:p></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 lang="IT" style="font-size:8.0pt;font-family:"Arial","sans-serif";color:#333333"><a href="http://www.ericsson.com/email_disclaimer"><span lang="EN-US" style="color:#333333">www.ericsson.com/email_disclaimer</span></a>
</span><span lang="IT" style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span><span style="font-size:12.0pt;font-family:"Times New Roman","serif""><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>