Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
lwc:shellhub [2022/08/18 13:11] – John Harrison | lwc:shellhub [2024/01/01 14:07] (current) – John Harrison | ||
---|---|---|---|
Line 3: | Line 3: | ||
* if you are already running ssh on the host you'll need to create (or add to) a '' | * if you are already running ssh on the host you'll need to create (or add to) a '' | ||
* you'll use this port # when logging into the remotes via ssh cli e.g. '' | * you'll use this port # when logging into the remotes via ssh cli e.g. '' | ||
- | * [[https:// | + | * [[https:// |
+ | * for ssl add to '' | ||
+ | < | ||
+ | SHELLHUB_AUTO_SSL=true | ||
+ | SHELLHUB_REDIRECT_TO_HTTPS=true | ||
+ | SHELLHUB_DOMAIN=< | ||
+ | </ | ||
+ | === autostart === | ||
+ | Add a '' | ||
+ | * create ''/ | ||
+ | < | ||
+ | [Unit] | ||
+ | Description=ShellHub | ||
+ | After=network.target | ||
+ | |||
+ | [Service] | ||
+ | User=root | ||
+ | Type=simple | ||
+ | WorkingDirectory=< | ||
+ | ExecStart=make start | ||
+ | Restart=always | ||
+ | |||
+ | [Install] | ||
+ | WantedBy=multi-user.target | ||
+ | </ | ||
+ | * '' | ||
+ | * '' | ||
==== Remote ==== | ==== Remote ==== | ||
* Shellhub provides a docker container for RPI and friends but our candidate was a riscv64 mangopi for which there was no suitable Docker container | * 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 [[https:// | + | * Instead we cloned the repo then [[https:// |
+ | < | ||
+ | git clone -b v0.10.4 https:// | ||
+ | sudo apt install golang | ||
+ | cd shellhub/ | ||
+ | go build -ldflags "-X main.AgentVersion=v0.10.4" | ||
+ | </ | ||
+ | * {{ : | ||
* Format for the public/ | * Format for the public/ | ||
- | ==== ToDo ==== | + | === Autostart of Agent === |
- | * autostart of host | + | * add a script '' |
- | * autostart | + | < |
- | * ssl | + | # |
+ | export SHELLHUB_TENANT_ID=" | ||
+ | export SHELLHUB_PRIVATE_KEY=" | ||
+ | export SHELLHUB_SERVER_ADDRESS=" | ||
+ | ./agent | ||
+ | </ | ||
+ | * '' | ||
+ | * starting the script from the shell works fine but for some reason does not work with '' | ||
+ | * '' | ||
+ | * create ''/ | ||
+ | < | ||
+ | [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 | ||
+ | </ | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | === Login with cert to remote (agent) | ||
+ | * local machine generate public/ | ||
+ | * it could be that any public/ | ||
+ | * upload public key to web portal (public keys menu on LHS) | ||
+ | * make sure private key on local machine has permissions 600 | ||
+ | * login from local machine using private key: '' | ||
+ | |||
+ | === Disable Password login === | ||
+ | //This is not a built-in function for community edition it appears so as a workaround we can hack the code// | ||
+ | * pre v0.13.0: in ''/ | ||
+ | * post v0.13.0: in ''/ | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | ==== Setting up VNC on remote (Xubuntu 22.04) ==== | ||
+ | === On Remote === | ||
+ | * '' | ||
+ | * change '' | ||
+ | < | ||
+ | env -i /bin/sh -c " | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | / | ||
+ | </ | ||
+ | * write a script: | ||
+ | < | ||
+ | # | ||
+ | if ! pgrep -x " | ||
+ | then | ||
+ | vncserver -geometry 1366x768 | ||
+ | fi | ||
+ | </ | ||
+ | * call this script in session and startup (yes systemd is the right way to do this but I couldn' | ||
+ | * restart Xserver | ||
+ | === local === | ||
+ | * '' | ||
+ | * then in a separate window '' | ||
+ |