Public servers are guessed at all day. Keys, no passwords and another port in three steps, each with a way back.
The Hiddify Manager menu warns while password sign-in is on. The log shows why:
journalctl -u ssh --since today | grep -c "Failed password"Hundreds or thousands a day are common on a new machine.
From the first minute programs try passwords on every public server. They do not know you; they scan whole ranges. However safe the panel is, a guessed root password gives away every user's keys.
Step 1: make a key
On your own computer:
ssh-keygen -t ed25519Press Enter throughout. Send the public half with ssh-copy-id root@IP on Mac and Linux, or on Windows:
type $env:USERPROFILE\.ssh\id_ed25519.pub | ssh root@IP "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"Sign in from another window; no password question means it works.

Step 2: no passwords
echo "PasswordAuthentication no" > /etc/ssh/sshd_config.d/00-key-only.conf
sshd -t && systemctl reload sshsshd -t checks the syntax and stops on an error. Keep the old window open.
Step 3: another port (optional)
It stops nobody determined but most of the noise. Allow the new port in the security group, change it, sign in with it, close 22 last. On Ubuntu 24.04 SSH listens through a systemd socket, so after changing Port also run:
systemctl daemon-reload
systemctl restart ssh.socket
Ways back
| Risk | Way back |
|---|---|
| Key file lost | A copy on a stick or in a password manager |
| Wrong setting | The host's web console |
| New computer | Add its key beforehand |
- Key workschecked in another window
- Passwords offold window stays
- Port lastsecurity group first
Who is knocking
journalctl -u ssh --since "24 hours ago" | grep "Failed password" | grep -oE "from [0-9.]+" | sort | uniq -c | sort -rn | head
last -n 5If last shows an address you do not know, do not repair: back up the panel and reinstall.
Why keys are stronger
A password is sent and can be guessed. A private key never leaves your computer; the server asks a question only it can answer. With a passphrase a stolen file is useless too.
Where Windows users get stuck
- Files are in
C:\Users\you\.ssh\. .pubis the public one and goes to the server.- PuTTY needs conversion with PuTTYgen.
UNPROTECTED PRIVATE KEY FILE: remove other users' permissions.
Still asked for a password? Permissions on the server:
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
chown -R root:root ~/.sshBefore turning passwords off
- A new window logs in with the key.
- The private key has a copy elsewhere.
- The host's console opens and you know the root password.
Then check:
ssh -o PubkeyAuthentication=no root@IPPermission denied (publickey) is right. If it still asks, another file in /etc/ssh/sshd_config.d/ such as 50-cloud-init.conf turns it on; the first name wins, hence 00-.
What changing the port does
A random five-digit port removes nine tenths of the noise. Not much safer, but real events become visible.
Host home
HostName 203.0.113.10
Port 28022
User root
IdentityFile ~/.ssh/id_ed25519Then ssh home is enough.
One more layer
With a fixed IP allow only it in the host's firewall. Keep the console as a way back. And turn on security updates:
apt install -y unattended-upgrades
dpkg-reconfigure -plow unattended-upgradesOfficial support asks to log in.
The menu has add_remote, only for when they ask; run remove_remote afterwards.
Is fail2ban still needed?
With passwords off, guessing is useless; it is up to you.
Copy the key between computers?
Better one pair per computer; if one is lost, remove its line.
A normal user with sudo?
Tidier, but Hiddify Manager needs root. Root with keys is acceptable for yourself.
Change the panel password too?
Yes, long and used nowhere else.


