Blog / Tutorials

The First Ten Minutes on a Fresh VPS — What Actually Matters

By the NoctHost TeamAugust 12, 20265 min read

You just got the root password emailed to you (or better, you dropped in an SSH key at signup). The box is naked, it has a public IP, and the internet already knows it exists — automated scanners find a new host within minutes and start guessing `root` / `123456`. The good news is that the stuff that actually protects you takes about ten minutes and never needs touching again.

I'm going to give you the short list that matters, then tell you which popular "hardening" steps are mostly theater. Skipping the theater is not laziness. Every extra moving part is something that breaks at 2am when you've forgotten it exists.

Log in and make a real user

SSH in as root the one time, then create a normal account for yourself and give it sudo. Living as root full-time means every typo runs with full privileges, and every service you start inherits that sloppiness.

adduser deploy
usermod -aG sudo deploy

Copy your SSH key to the new user so you can log in as them:

rsync --archive --chown=deploy:deploy ~/.ssh /home/deploy/

Open a second terminal and confirm ssh deploy@your-ip works and sudo whoami prints root before you go any further. Never lock yourself out of a box by editing SSH config in your only session.

Turn off password logins entirely

This is the single highest-value thing on the list. Once your key works, keys become the only way in, and the entire category of password-guessing attacks — which is 99% of the noise in your auth log — simply stops mattering. A brute-force against a 4096-bit key is not happening this side of the heat death of the universe.

Edit /etc/ssh/sshd_config (on newer distros the real setting may live in /etc/ssh/sshd_config.d/):

PasswordAuthentication no
PermitRootLogin no
KbdInteractiveAuthentication no

Then reload and, again, test from a fresh terminal before closing the one you have:

sudo systemctl reload ssh

If your provider hands you a root password by default, this step is what neuters it.

Put up a firewall

Default-deny inbound, allow the couple of ports you actually use. ufw is the least painful way to do this on Ubuntu/Debian:

sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow OpenSSH
sudo ufw enable

Add ports as you add services (sudo ufw allow 80,443/tcp when you put up a web server). The point isn't that a firewall stops a determined attacker — a service you deliberately expose is exposed regardless. The point is that it stops you from accidentally exposing the database you bound to 0.0.0.0 at midnight and forgot about. Most real breaches are an accident you made, not an attack you suffered.

Let it patch itself

Unattended security upgrades are boring and they are the reason you don't wake up to a wormed box because you were three weeks behind on an OpenSSL CVE.

sudo apt install unattended-upgrades
sudo dpkg-reconfigure -plow unattended-upgrades

By default it only applies security updates, which almost never break anything. If you run something fragile, leave automatic reboots off and just reboot on your own schedule when the box tells you a kernel update is pending.

That's the list. Non-root user, key-only SSH, a firewall, auto-patching. If you do nothing else, you've closed the doors that actually get kicked in.

The stuff you can skip (and why)

Now the cargo cult. None of these are wrong, exactly. They're low-value ceremony that people perform because a blog told them to in 2013, and each adds friction or a false sense of safety.

  • Changing the SSH port. Moving 22 to 2222 quiets the dumb scanner noise in your logs, and that's the entire benefit. It's not security — a real scan finds your SSH in seconds. You bought tidiness, not protection, and now you've a non-standard port to remember everywhere forever.
  • Port knocking. A sequence of "secret" packets to open the port. Clever, fragile, and it breaks the moment you're on a network that mangles the timing. Key-only auth already gives you everything knocking pretends to.
  • fail2ban as your main defense. It bans IPs after failed logins — but once password auth is off, there are no meaningful failed logins to ban. On a key-only box it's guarding a door that's already welded shut. Fine for password-protected web apps; redundant for SSH. People install it to feel safe, then skip the actual fix.

Do the few things that remove whole classes of attack, and resist piling on rituals that only generate the feeling of security. A clean box with keys-only SSH and a firewall beats one buried under six half-configured security tools.

Tip — One genuinely useful extra: use a separate SSH key per machine you log in from, not one key shared everywhere. Lose a laptop and you revoke one line in authorized_keys instead of rotating everything.

Whether the box came from a hyperscaler or somewhere like NoctHost where you sign up with just an email and pay in crypto, this checklist is identical — the provider hands you a clean box, and the first ten minutes are on you.

Spin one up in about a minute

Email signup, pay with crypto, hourly billing. Trying a box costs cents — destroy it when you are done.

Deploy a server

Frequently asked

Do I really need to disable root login if I use a strong password?
Yes. The attack isn't against your password's strength — it's the sheer volume of automated guessing aimed at root specifically. Disable password auth entirely and there's nothing to guess.
Is fail2ban useless?
Not useless, just misapplied on a key-only SSH box, where there are no password attempts to throttle. It earns its keep protecting password-based web logins. As SSH protection behind key-only auth, it's redundant.
What's the one thing to do if I only have two minutes?
Add your SSH key, then set PasswordAuthentication no and reload SSH — after confirming the key works in a second terminal. That single change removes the overwhelming majority of real-world attack traffic.

Keep reading