lwc:shellhub

This is an old revision of the document!


Shellhub is an open source alternative to Dataplicity. Run the Shellhub host on a host computer then run the agents on the remotes.

  • if you are already running ssh on the host you'll need to create (or add to) a .env.override file SHELLHUB_SSH_PORT=<SOMETHING_OTHER_THAN_22>
    • you'll use this port # when logging into the remotes via ssh cli e.g. ssh -p <PORT_#> <USER>@<SSHID_FOR_REMOTE>@<HOST_IP_OR_NAME>
  • directions for install (dev environment not necessary)
  • for ssl add to .env.override:
SHELLHUB_AUTO_SSL=true
SHELLHUB_REDIRECT_TO_HTTPS=true
SHELLHUB_DOMAIN=<your domain or subdomain without quotes>

autostart

Add a systemd service:

  • create /etc/systemd/system/shellhub.service:
[Unit]
Description=ShellHub
After=network.target

[Service]
User=root
Type=simple
WorkingDirectory=<DIRECTORY WHERE SHELLHUB ROOT LIVES>
ExecStart=make start
Restart=always

[Install]
WantedBy=multi-user.target
  • sudo systemctl enable shellhub.service
  • sudo systemctl start shellhub.service # does enable already imply start?
  • Shellhub provides a docker container for RPI and friends but our candidate was a riscv64 mangopi for which there was no suitable Docker container
  • Instead we cloned the repo then built the agent from source
  • Format for the public/private keys must be pem so ssh keys from standard ssh-keygen will not work. Instead do something like: ssh-keygen -t rsa -f key.pem -m pem with -m pem being the magic sauce (source).
  • autostart of host
  • autostart of remote (agent)
  • lwc/shellhub.1660870892.txt.gz
  • Last modified: 2022/08/18 20:01
  • by John Harrison