Install on a host without OpenSSH
Routers, NAS boxes and small Linux images often ship Dropbear, or no SSH server at all. The agent still installs and connects, but no shell opens until the device runs the OpenSSH server.
Why it needs OpenSSH
A shell is a session on the device's own SSH server. For each session the
agent writes a one-time key that only that session can use, and OpenSSH reads
it through its AuthorizedKeysCommand setting. Dropbear has no
such setting, so it cannot be used. We do not fall back to passwords or to any
other way in: the device still trusts only the keys and accounts you named
when you installed.
See what the device has
Run this on the device, as root:
command -v sshd dropbear
ps | grep -E 'sshd|dropbear' | grep -v grep
-
Only
dropbear: Dropbear is not supported. Install OpenSSH below. Dropbear usually listens on port 22, which sshd needs too, so move it first. - Neither: there is no SSH server. Install OpenSSH below.
-
sshdis there but not running: start it. The installer prints the command for your init system.
The installer checks the same things and prints what it found and what to run when it ends. It never installs packages for you, and it still installs the agent, so you can run it first and use what it prints.
OpenWrt
OpenWrt ships Dropbear on port 22. Move it, install OpenSSH, then start it. If you are logged in over SSH, run this from the serial console or a second session you can reopen: restarting Dropbear can drop the one you are in. The whole path for a router behind CGNAT is in the OpenWrt guide.
uci set dropbear.@dropbear[0].Port='2222'
uci commit dropbear
/etc/init.d/dropbear restart
opkg update
opkg install openssh-server openssh-keygen curl ca-bundle openssl-util
/etc/init.d/sshd enable
/etc/init.d/sshd start
-
openssh-serverbrings the init script, which makes host keys on first start, and a configuration that reads/etc/ssh/sshd_config.d/.openssh-keygenis the key tool. -
On OpenWrt the installer sets the agent up as a procd service. It starts on
boot, and procd starts it again if it stops. If the relay refuses the
device's credential, the agent stops instead of retrying, and nothing is
deleted. Check it with
/etc/init.d/rescueshell-agent running./etc/init.d/rescueshell-agent stopstops it for now, and/etc/init.d/rescueshell-agent disablekeeps it from starting at boot. -
OpenWrt keeps
/varin memory, and the installer will not store the device credential where a reboot would lose it. Add--state-dir /etc/rescueshellto the install command so it lands on flash. -
curl,ca-bundleandopenssl-utilare what the installer uses to download the agent and check its signature. -
From now on, a plain Dropbear login uses port 2222:
ssh -p 2222 root@192.168.1.1. Once you have opened a shell through RescueShell, you can switch Dropbear off with/etc/init.d/dropbear disableand/etc/init.d/dropbear stop. -
OpenSSH needs a few MB of flash on x86_64, more than Dropbear. Check
df -h /overlayfirst; a router with very little flash may not fit it. Other architectures differ. - We checked these package names, the init script and the configuration in the OpenWrt 24.10 package feed. We ran the installer and the boot service on an OpenWrt 23.05 image in a container, not on a router. We do not run OpenWrt in our device matrix.
Alpine and BusyBox images
On Alpine, with OpenRC:
apk add openssh openssl curl ca-certificates
rc-update add sshd default
rc-service sshd start
If Dropbear runs there, stop it or move it off port 22 first:
rc-service dropbear stop
rc-update del dropbear
To keep it, set DROPBEAR_OPTS="-p 2222" in
/etc/conf.d/dropbear and run
rc-service dropbear restart
instead.
A BusyBox image with no package manager has to get OpenSSH in at build time. The Buildroot guide covers that, and the init script and read-only root that go with it. More on Alpine in the Alpine guide.
Debian and Ubuntu
apt-get install -y openssh-server
systemctl enable --now ssh
On Fedora and RHEL the packages and service are
dnf install -y openssh-server and
systemctl enable --now sshd. See the
Debian and Ubuntu guide for
what the installer sets up.
NAS boxes
Most NAS systems have an SSH switch in their admin pages that starts a built-in server. Turn it on and run the check above. If it is OpenSSH, the installer works as it does anywhere else. If it is Dropbear, or the system will not let you add packages, you cannot use it today. We have not tested NAS firmware. Two things to expect on the ones that do work:
-
The sshd configuration may not read
sshd_config.d. The installer then prints the two lines to add tosshd_configyourself, and says it left sshd alone. - A firmware update can reset the SSH settings or remove files outside the data volume. Run the install command again afterwards.
Then install, or run the installer again
Create a token in the dashboard, then run this as root:
curl -fsSL https://releases.rescueshell.com/latest/install.sh | sh -s -- \
--base-url https://releases.rescueshell.com/latest --relay https://app.rescueshell.com \
--name pump-07 --trust-keys-from pi
Change pi to the account you log in as. See
add a device for the other options. A device
you already installed needs the same command again: it adds the sshd lines and
reloads sshd.
When it works, the installer prints no ssh server: lines, and a
shell opens from the device's page. If it does not, see
the shell does not open.