SSH Hardening

Updated 14 Nov 2026 Published

SSH Hardening

SSH is the way into your server when the panel is not enough — and the first thing attackers try. This page shows how to tighten it with the SSH Manager app, how to manage SSH keys, how SSH access works for hosting accounts, and how to change the SSH port without locking yourself out.

SSH Manager

SSH Manager is free on every plan, including the Free plan. Install it from the Vinza Store (top bar); it appears under Security → SSH Manager (/apps/ssh-manager/). It has four tabs:

TabWhat it does
SessionsWho is logged in right now (user, TTY, from, login time), whether sshd is running and its OpenSSH version. Administrators can End session.
HardeningRead and change a safe set of sshd_config directives, plus the Key audit
SSH keysAdd, generate and remove the SSH public keys of a Linux account, with expiry, allowed addresses and deploy keys
Login historyAccepted and failed SSH logins

SSH Manager Hardening tab with the sshd_config directive table, per-directive Save buttons and the Reload SSHD button

Harden sshd_config

The Hardening tab can change only these directives, each checked against its allowed values:

DirectiveAllowed valuesRecommended
PermitRootLoginyes, no, prohibit-password, without-passwordprohibit-password or no
PasswordAuthenticationyes, nono, once your key works
PubkeyAuthenticationyes, noyes
Port1–65535see below
X11Forwardingyes, nono
MaxAuthTries1–100a low number, e.g. 3
PermitEmptyPasswordsyes, nono
AllowUsers / AllowGroupsspace-separated names or patterns; empty removes the directiveonly the accounts that need SSH
ClientAliveInterval0–3600 secondse.g. 300, to drop dead sessions
ClientAliveCountMax0–100a low number, e.g. 2
LoginGraceTime0–600 secondse.g. 30

Only the global section of the file is edited; anything inside a Match block is left alone. The page shows the values sshd actually runs with, and its settings win over drop-in files in /etc/ssh/sshd_config.d/ (such as those cloud images add).

Every change is checked with sshd -t and rolled back if sshd rejects it. An AllowUsers or AllowGroups list that would shut out root (while PermitRootLogin allows it), an account with a live SSH session or your own account is refused. Changes are written immediately but take effect only after you click Reload SSHD, and Reload refuses a configuration that fails the check.

Danger

Before you set PasswordAuthentication no or change the port, keep your current SSH session open, reload, and test a new connection from another terminal. Only close the old session once the new one works.

Key audit and login alerts

The Key audit card on the Hardening tab lists every key on the server that needs attention — weak RSA keys, DSA keys (refused by current OpenSSH), unreadable keys, and keys that have expired or are about to — with a Notify owner button. On the same card you can switch on Alert when an account logs in from a new address (checked every 5 minutes; administrators and the account owner are told) and set how many days before expiry the key reminders go out.

Manage SSH keys

On the SSH keys tab, administrators pick a Linux account from the list (it shows how many keys each account has and whether its shell can log in). The account's keys are listed with their name, type and size, a strength badge and a SHA-256 fingerprint you can copy. A short How SSH key login works guide shows the exact ssh command for the account, including the server's SSH port.

Add an existing key

  1. On your computer, create a key if you don't have one: ssh-keygen -t ed25519.
  2. Click Add public key and paste the contents of the .pub file (for example ~/.ssh/id_ed25519.pub). Several keys can go in at once, one per line. Optionally give the key a name so you know which device it belongs to.
  3. Click Add key.

The paste box checks the key as you type and refuses a private key. Supported key types are ed25519, RSA, DSA, ECDSA and the FIDO sk- variants. Options and forced commands (such as command=) cannot be pasted — use Key options or a deploy key instead. Remove key deletes one.

Generate a key pair in the panel

If the computer you will connect from has no key yet, click Generate key pair. The panel creates an ed25519 pair (optionally protected with a passphrase), shows the private key once for you to copy or download, and does not store it. Tick Allow this key to log in to the account right away to add the public half at the same time. Save the private key as ~/.ssh/id_ed25519 and run chmod 600 ~/.ssh/id_ed25519.

Key options: expiry and allowed addresses

Use Key options on a key to set the following (an expiry date can also be set when you add the key):

  • Expires on — from this date the key no longer logs in (sshd's expiry-time). Administrators and the account owner get a reminder before it runs out.
  • Only from these addresses — IP addresses, CIDR networks or host name patterns, separated by commas (from=). A key for a CI runner should list only the runner's address.

Deploy keys

A Deploy key is a key for a machine, not a person: it cannot open a shell or forward ports and may run only one job —

  • git clone / push over SSH only (git-shell), or
  • copy files in or out of the home folder only (rrsync), optionally Read only.

Give the private key to the CI runner or the backup server.

Hosting users who open SSH Manager see a self-service view: the keys of their own account and their own login history.

SSH for hosting accounts

Every panel account has a Linux user whose password is the panel password. Whether that user may log in over SSH (and SFTP) is decided by its hosting plan's Allow SSH / Terminal switch: without it, the account's login shell is set to /usr/sbin/nologin, which blocks password and key logins alike, and SSH Manager tells the user that their plan does not include SSH access. Turning SSH on or off in a plan re-applies it to every account on that plan. See Hosting Plans.

Changing the SSH port

SSH Manager only edits the configuration — it does not open firewall ports. To move SSH to another port:

  1. Open the new port in your firewall first: Management → Firewall (UFW), or the Ports tab of Sentinel CSF. Also check your cloud provider's firewall or security group.
  2. In SSH Manager → Hardening, set Port to the new value and click Reload SSHD.
  3. Test from a new terminal:
    ssh -p 2222 root@YOUR_SERVER_IP
  4. When it works, close port 22 in the firewall.
Tip

Pair SSH hardening with the sshd jail of Fail2Ban — see fail2ban Configuration. Security Advisor also checks your SSH settings.

On this page