Home

Awesome

shelly

main

Shelly is an erlang OTP application that makes it simple to have a remote shell into your application.

Running a SSH daemon in erlang is already very simple. This is a general purpose micro application that you can include in your OTP application enabling remote SSH directly into the BEAM.

Shelly uses the following environment variables:

VariableDefaultDescription
SHELLY_PORT22Shelly listens for incoming SSH connections on this port
SHELLY_ENABLEDtrueShelly is enabled when this value is true
SHELLY_SYSTEM_DIRpriv/sshShelly uses this directory to find the host key
SHELLY_USER_DIRpriv/sshShelly uses this directory to find authorised_keys
SHELLY_AUTHORIZED_KEYSThe authorized keys to use overriding SHELLY_USER_DIR

Assuming that ~/.ssh contains an authorized_keys file, typical usage:

SHELLY_USER_DIR=~/.ssh SHELLY_PORT=22022 make shell

Or:

SHELLY_PORT=22022 SHELLY_AUTHORIZED_KEYS="$(cat ~/.ssh/authorized_keys)" make shell

The above is useful for dockerized applications to supply the authorizeds keys without having to setup volumes.

In another shell, you can log into the BEAM as follows:

ssh -p 22022 localhost
Eshell V7.3  (abort with ^G)
(shelly@Office-iMac)1>