[erlang-questions] How to use ssh:connect?

唐宾宾 <>
Mon Sep 2 08:02:41 CEST 2013


hi all:
I have done the following test:

on client A :
$ ssh-keygen -t rsa -f /opt/ssh_daemon/ssh_host_rsa_key
$ ssh-keygen -t rsa -f /opt/tangbinbin/.ssh/id_rsa
Eshell V5.10.2  (abort with ^G)
1> crypto:start().
ok
2> ssh:start().
ok
3> {ok, Sshd} = ssh:daemon(8989,  [{system_dir, "/opt/ssh_daemon"}, 
{user_dir, "/opt/tangbinbin/.ssh"}]).
{ok,<0.52.0>}
$netstat -lntp | grep 8989
tcp6       0      0 :::8989 :::*                    LISTEN      
6792/beam.smp

on server B
Erlang R16B01 (erts-5.10.2) [source] [64-bit] [smp:4:4] 
[async-threads:10] [kernel-poll:false]

Eshell V5.10.2  (abort with ^G)
1> crypto:start().
ok
2> ssh:start().
ok
3> ssh:connect("HostA", 8989, [{user_dir, "/opt/tangbinbin/.ssh"}]).
New host 192.168.0.203 accept [y/n]?y
{error,{"Key exchange failed",{error,eacces}}}

How to connnet with A?


More information about the erlang-questions mailing list