GoAdmio

dropbear

Install Dropbear (a lightweight SSH server) on a custom port, or show the current Dropbear port

On this page: Overview · Quick start · Syntax · Options · Output · Examples · Troubleshooting · Details · See also


Overview

/go/dropbear installs Dropbear, a small SSH server, and sets the port it listens on. It:

Dropbear runs alongside OpenSSH on its own port; the command does not change or stop OpenSSH. To change the OpenSSH port, use port.

The call is appended to /var/log/go/dropbear.log.


Quick start

# Install Dropbear on the default port (2222)
/go/dropbear

# Install Dropbear on port 2200
/go/dropbear 2200

Syntax

/go/dropbear [port-number] [--install]
/go/dropbear port
Form Behavior
/go/dropbear Installs or reconfigures Dropbear on port 2222.
/go/dropbear <port-number> Same, on the port you give.
/go/dropbear port Prints the port Dropbear is configured for, then exits. PORT works too.

It supports AlmaLinux, Rocky Linux, CentOS, Red Hat, Fedora, Debian, and Ubuntu. On any other system it changes nothing.


Options

Argument Default Notes
<port-number> 2222 Must be the first argument. It is not checked: use a free number from 1 to 65535. Port 22 is normally taken by OpenSSH.
port — Shows the configured port instead of installing.
--install — Skips the config --force step. Meant for use while GoAdmio is being installed. Put it after the port number (see below).

Output

The command prints one line when it finishes:

Dropbear SSH Port has been changed successfully.

The line is printed even if the package install failed or the system isn't supported, so check the result with systemctl status dropbear.

/go/dropbear port prints only the port number.


Examples

# Default port
/go/dropbear
# Custom port, then connect
/go/dropbear 2200
ssh -p 2200 root@203.0.113.10
# Show the configured port
/go/dropbear port
# Install on the default port without refreshing the GoAdmio configuration
/go/dropbear 2222 --install

Troubleshooting

Symptom Likely cause Fix
The package isn't found on an AlmaLinux, Rocky, CentOS, or Red Hat server dropbear isn't in the enabled repositories (it is normally in EPEL). Enable EPEL, then run the command again.
Can't connect on the new port The firewall rule isn't open yet, the port is in use, or Dropbear isn't running. Run checkfirewall, then check systemctl status dropbear.
Dropbear fails to start Another service (often OpenSSH on 22) already uses the port. Pick a free port and run the command again.
port prints nothing or an error Dropbear isn't installed, or the system isn't supported. Run /go/dropbear first.
The configuration contains -p --install --install was passed as the first argument and was read as the port. Run /go/dropbear <port> again, with the port first.

Details

The command runs these steps:

  1. Reads the port from the first argument, or uses 2222.

  2. Installs dropbear if it is missing (dnf on the RHEL family, apt on Debian and Ubuntu).

  3. Overwrites the configuration file with the port only:

    System File Content
    RHEL family /etc/sysconfig/dropbear OPTIONS="-p <port>"
    Debian, Ubuntu /etc/default/dropbear DROPBEAR_PORT=<port> and an empty DROPBEAR_EXTRA_ARGS
  4. Opens the port with allow, in a background screen session, so it may finish after the command returns.

  5. Unless --install was given, runs config --force to refresh GoAdmio's server configuration.

  6. Enables and restarts the dropbear service.

[!NOTE] Only the port is configured, and any earlier custom options in the file are replaced. Review Dropbear's other options if you need them, for example -w to refuse root logins.


See also

Command Description
installssh Reinstall and enable the OpenSSH server
port Change the default SSH port (22) to another port
ssh Rewrite /etc/ssh/sshd_config with GoAdmio hardening
allow Open a port in your server's firewall
checkfirewall Verify that important required ports are open on your server
config Show or edit the server's GoAdmio configuration