Shellhub is an open source alternative to Dataplicity. Run the Shellhub host on a host computer then run the agents on the remotes.
.env.override file SHELLHUB_SSH_PORT=<SOMETHING_OTHER_THAN_22>ssh -p <PORT_#> <USER>@<SSHID_FOR_REMOTE>@<HOST_IP_OR_NAME>.env.override:SHELLHUB_AUTO_SSL=true SHELLHUB_REDIRECT_TO_HTTPS=true SHELLHUB_DOMAIN=<your domain or subdomain without quotes>
Add a systemd service:
/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.servicesudo systemctl start shellhub.servicegit clone -b v0.10.4 https://github.com/shellhub-io/shellhub.git shellhub sudo apt install golang cd shellhub/agent go build -ldflags "-X main.AgentVersion=v0.10.4"
(curl https: // <SERVER>/info'' shows the server version).
golang package is 1.24, so install the official Go tarball in your home directory instead (no sudo needed):curl -LO https://go.dev/dl/go1.26.11.linux-amd64.tar.gz tar -C ~/.local -xzf go1.26.11.linux-amd64.tar.gz export PATH=$HOME/.local/go/bin:$PATH git clone -b v0.26.0 https://github.com/shellhub-io/shellhub.git shellhub cd shellhub/agent go build -ldflags "-X main.AgentVersion=v0.26.0" -o agent .
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). dash change needed: put the environment variables directly in the unitSHELLHUB_PRIVATE_KEY on first start if the file doesn't existsudo install -m 755 agent /usr/local/bin/shellhub-agentsudo install -d -m 700 /etc/shellhub/etc/systemd/system/shellhub-agent.service:[Unit] Description=ShellHub Agent Wants=network-online.target After=network-online.target [Service] Type=simple User=root Environment=SHELLHUB_SERVER_ADDRESS=<SHELLHUB SERVER ADDRESS> Environment=SHELLHUB_TENANT_ID=<TENANT_ID> Environment=SHELLHUB_PRIVATE_KEY=/etc/shellhub/agent.key ExecStart=/usr/local/bin/shellhub-agent Restart=always RestartSec=5 [Install] WantedBy=multi-user.target
sudo systemctl daemon-reload && sudo systemctl enable --now shellhub-agentsudo journalctl -u shellhub-agent -n 20 (look for Server connection established), then accept the device in the web portalstartAgent.sh to start the agent:#!/bin/bash export SHELLHUB_TENANT_ID="TENANT_ID" export SHELLHUB_PRIVATE_KEY="PRIVATE KEY PATH AND FILENAME IN PEM FORMAT" export SHELLHUB_SERVER_ADDRESS="SHELLHUB SERVER ADDRESS" ./agent
sudo chmod 755 startAgent.shsystemd unless we change /bin/sh to use bash instead of dashsudo dpkg-reconfigure dash and choose no when prompted/etc/systemd/system/shellhubAgent.service[Unit] Description=ShellhubAgent After=network.target [Service] User=root Type=simple WorkingDirectory=FULL PATH WHERE AGENT AND STARTUP SCRIPT ARE LOCATED ExecStart=FULL PATH AND FILENAME OF STARTUP SCRIPT Restart=always [Install] WantedBy=multi-user.target
sudo systemctl enable shellhubAgent.servicesudo systemctl start shellhubAgent.servicessh-keygen -t ed25519ssh -p <PORT> -i <PRIVATE_KEY_PATH_AND_FILE> <USER>@<SSHID_FOR_REMOTE>@<HOST_IP_OR_NAME><NAMESPACE>.<DEVICE_NAME>@<HOST>. If you rename the device in the web portal, the SSHID uses the new name (the old MAC-based name stops working)This is not a built-in function for community edition it appears so as a workaround we can hack the code
/pkg/agent/server/server.go edit func (s *Server) passwordHandler( so the first line of the method reads return false/pkg/agent/server/authentication.go edit func (s *Server) passwordHandler(ctx gliderssh.Context, pass string) bool { so the first line of the method reads return false/agent/server/authentication.go (there is no pkg/agent directory anymore)ssh -p <PORT> -o PubkeyAuthentication=no -o PreferredAuthentications=password <USER>@<SSHID> should give Permission denied even with the correct password. The gateway still lists password as a method; the agent is what refuses itcd shellhub/agentgo build -ldflags "-X main.AgentVersion=<VERSION>"sudo apt install xtightvncviewer~/.vnc/xstartup to read:env -i /bin/sh -c "export PATH=$PATH;
export XAUTHORITY=$XAUTHORITY;
export DISPLAY=$DISPLAY;
export HOME=$HOME;
export LOGNAME=$LOGNAME;
export USER=$USER;
/usr/bin/xfce4-session"
#!/bin/bash
if ! pgrep -x "Xtightvnc" >/dev/null
then
vncserver -geometry 1366x768
fi
ssh -p 24 -i <PRIVATE_KEY> <NAME_OF_REMOTE> -L 5901:127.0.0.1:5901gvncviewer :1