[erlang-bugs] SSH undef using with no user interaction and missing authorized key

Adam Lindberg <>
Sun Nov 24 13:51:16 CET 2013


Hi!

Using SSH in Erlang R16B02, trying to connect to localhost on OS X 10.9,
using [{user_dir, ...}, {user_interaction, false}] produces an undef
error because ssh_no_io does not have the function yes_no/2. The error
cannot be produced by using only {user_interaction, false}.
authorized_keys are not set up on this machine, so the login (without
{user_dir, ...} is of course unsuccessful.

Cheers,
Adam


Full output:

Erlang R16B02 (erts-5.10.3) [source] [64-bit] [smp:4:4]
[async-threads:10] [hipe] [kernel-poll:false] [dtrace]

Eshell V5.10.3  (abort with ^G)
1> ssh:start().
ok
2> {ok, Conn} = ssh:connect("localhost", 22, [{user_interaction,
false}]).
** exception error: no match of right hand side value {error,
                                                       "Unable to
                                                       connect using the
                                                       available
                                                       authentication
                                                       methods"}
3> {ok, Conn} = ssh:connect("localhost", 22, [{user_dir,
"/Users/username"}, {user_interaction, false}]).
** exception error: no match of right hand side value {error,"Internal
error"}
4>
=ERROR REPORT==== 24-Nov-2013::13:09:17 ===
Erlang ssh connection handler failed with reason: undef
, Stacktace: [{ssh_no_io,yes_no,
                         ["New host localhost accept",
                          {ssh,client,
                               {"localhost",{{0,0,0,0,0,0,0,1},22}},
                               {2,0},
                               {2,0},
                               "SSH-2.0-Erlang","SSH-2.0-OpenSSH_6.2",
                               <<...big binary...>>,
                               <<...big binary...>>,
                               {alg,'diffie-hellman-group1-sha1','ssh-rsa',
                                    'hmac-sha1','hmac-sha1','aes128-cbc',
                                    'aes128-cbc',none,none,none,none},
                               undefined,undefined,ssh_file,ssh_no_io,none,
                               undefined,0,none,undefined,0,none,undefined,8,
                               undefined,none,undefined,8,undefined,none,
                               undefined,none,undefined,none,none,true,
                               infinity,undefined,undefined,undefined,
                               [{address,"localhost"},
                                {port,22},
                                {user_pid,<0.57.0>},
                                {host,"localhost"},
                                {idle_time,infinity},
                                {user_interaction,false},
                                {user_dir,"/Users/alind"}],
                               2,2,
                               {{...big integer...,
                                 ...big integer...},
                                {2,
                                 ...big integer...}},
                               undefined,undefined,undefined,false,
                               "publickey,keyboard-interactive,password",
                               undefined,undefined,
                               ["ssh-rsa","ssh-dss"],
                               false}],
                         []},
              {ssh_transport,known_host_key,3,
                             [{file,"ssh_transport.erl"},{line,489}]},
              {ssh_transport,handle_kexdh_reply,2,
                             [{file,"ssh_transport.erl"},{line,354}]},
              {ssh_connection_handler,key_exchange,2,
                                      [{file,"ssh_connection_handler.erl"},
                                       {line,242}]},
              {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,505}]},
              {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]
please report this to 


More information about the erlang-bugs mailing list