[erlang-bugs] Bugs in SSH

Charles Ahn <>
Mon Nov 10 12:51:47 CET 2008


The ssh daemon will not function correctly (logging in fails) with  
only ssh_host_rsa_key and ssh_host_rsa_key.pub in system_dir. However,  
ssh_host_dsa_key and ssh_host_dsa_key.pub are sufficient by themselves  
for the ssh daemon to function correctly. This means that the ssh  
daemon does start if both keys exist but there seems to be no way to  
force the daemon to use the RSA keys.

Also, I have some code using the daemon in which two users connecting  
to the server (different logins), cause the server to close all open  
connections. (Ie, logging in as admin and root, and having admin type  
quit will close both connections). I wouldn't be surprised if this is  
because I am doing something wrong though:
-export([start/0, dispatch/0, dispatch_init/0, recv_loop/1]).


start() ->
   ssh:daemon({0,0,0,0}, 1122, [{shell, {?MODULE, dispatch, []}},
       {user_passwords, [{"admin", "admin"}, {"root", "admin"}]},  
{system_dir, "/erlang_test"}]).

dispatch() ->
   spawn(?MODULE, dispatch_init, []).

dispatch_init() ->
   io:format("Hello user!\n"),
   Rec = spawn_link(?MODULE, recv_loop, [self()]),

loop(Rec) ->
     {Rec, Line} ->
       io:format("~s~s",[?FG_GREEN, Line])
   case Line of
     "quit\n" ->
       io:format("Good bye!\n"),
       exit(Rec, ok);
     _ ->

recv_loop(Dispatcher) ->
   Prompt = "> ",
   Line = io:get_line(?RESET ++ Prompt),
   Dispatcher ! {self(), Line},


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2419 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20081110/530f5707/attachment.bin>

More information about the erlang-bugs mailing list