erlang shell via ssh

Jakob Cederlund jakob@REDACTED
Thu Dec 15 13:32:38 CET 2005


Claes Wikstom wrote:

> tobbe wrote:
>
>> Yesterday, I tried to setup so that I could get an Erlang shell via 
>> ssh access.
>> I failed! Sometimes I think the OTP man-pages are just a tiny bit too 
>> terse...
>>
>> Anyway, I do not want to run as root, so I tried:
>>
>> 1> ssh_sshd:listen(3322, [{user_passwords, [{"admin","admin"}]}]).
>> {ok,<0.33.0>}
>>
>> then I tried to connect with ssh:
>>
>> # ssh -p 3322 localhost
>>
>> But I just got an error report about 'eaccess' etc.
>>
>
>
> You must let the ssh server read it's private key. Your
> server crashed with eaccess when it tries to read /etc/ssh
>
> You need to give an option {system_dir, Dir} which is
> a readable  dir
>
>
> /klacke
>
>

Exactly! This is (maybe too tersely) mentioned under ssh_cm, listen. 
Since the host keys in /etc/ssh are used to identify the host by the 
sshd-process, it's important that these keys are readable only by root. 
(Otherwise they could be copied and used on another host.)
The easiest way to set up your erlang shell for use with ssh_sshd is to 
generate a new pair of host keys, with the unix command:
ssh-keygen -f ssh_host_rsa_key -t rsa -N ''
or:
ssh-keygen -f ssh_host_dsa_key -t dsa -N ''
Then you use the system_dir option to point these out for the erlang ssh 
daemon. (I'm goingn to write this in the manual, it really is terse.)
/Jakob




More information about the erlang-questions mailing list