# How do you secure a Linux VPS in Hong Kong, Tokyo or Singapore?

> How to secure a Linux VPS in Hong Kong, Tokyo or Singapore in 8 steps: updates, SSH keys, UFW, fail2ban and automatic patches.

- URL: https://jadekvm.com/guides/how-to-secure-a-linux-vps-in-hong-kong-tokyo-or-singapore/
- Last updated: 2026-11-16
- Publisher: JadeKVM (https://jadekvm.com)

This is how to secure a Linux VPS on Debian 13 or Ubuntu 24.04, from the first root login to automatic patches, in about 30 minutes.

**Quick answer — How do you secure a Linux VPS?**

To secure a Linux VPS in 8 steps, patch it, add a sudo user, sign in with an SSH key only, block root and password login, open only the ports you need in UFW, add fail2ban and enable automatic security updates. **JadeKVM** installs the key pasted at checkout, so the key step is done before you log in.

**In brief**

- **Order matters**: create and test the sudo user before you switch off root login.
- **Keys beat passwords**: with a key pasted at checkout, password login is already off on a JadeKVM server.
- **Firewall second**: allow SSH in UFW before you enable it, or the session drops.
- **Patches every day**: unattended-upgrades installs security fixes without a login.
- **Your job, not the host's**: backups and the software you add stay in your hands.

## How to secure a Linux VPS in 8 steps?

Keep your first SSH window open until step 4 works in a second window. The commands fit Debian 13 and Ubuntu 24.04.

1. **Update every package** — Run apt update and apt full-upgrade, then reboot if a new kernel was installed.
2. **Create a sudo user** — Add a named account with adduser and put it in the sudo group. Daily work happens there, not as root.
3. **Give the user your SSH key** — Copy the public key into the new account and test a key login from a second terminal.
4. **Switch off root and password login** — Write a small file in /etc/ssh/sshd_config.d/, check it with sshd -t, then reload SSH.
5. **Turn on UFW** — Allow OpenSSH first, deny other incoming traffic, then open 80 and 443 only if you serve a website.
6. **Install fail2ban** — It reads the SSH journal and blocks addresses that fail to log in again and again.
7. **Enable automatic security updates** — Install and switch on unattended-upgrades, so fixes arrive while you sleep.
8. **Check what listens** — Run ss -tlnp and close any service you did not mean to expose.

## Which risk does each step close?

*Eight hardening steps for a Debian 13 or Ubuntu 24.04 VPS, the risk each one closes and its main command*

| Step | Risk it closes | Main command | Watch out for |
| --- | --- | --- | --- |
| Updates | Known, published flaws | apt full-upgrade | A kernel update needs a reboot |
| Sudo user | Mistakes made as root | adduser, usermod -aG sudo | Test sudo before you lock root |
| SSH key | Password guessing | authorized_keys | Never paste the private key |
| No root, no password | Attacks on the root name | PermitRootLogin no | Lockout without a working key |
| UFW | Services you forgot | ufw enable | Allow OpenSSH first |
| fail2ban | Login floods | systemctl enable --now fail2ban | Your own typos can ban you |
| Auto updates | Patches left for months | unattended-upgrades | Rare service restarts |
| Port check | Open admin ports | ss -tlnp | Databases bound to 0.0.0.0 |

## Does the city change how you secure a Linux VPS?

**No: a server in Hong Kong, Tokyo or Singapore faces the same automated scans as one anywhere else.** Bots try root and common passwords on port 22 within hours of a new address going live. The city decides latency to your visitors, not the threat.

JadeKVM read WonderNetwork's public pings on 16 November 2026: Hong Kong sits 60 ms from Tokyo and 30 ms from Singapore. Latency figures on JadeKVM pages are public averages measured by WonderNetwork between its own servers on 16 November 2026; they show how far apart the cities sit on the network, not a promise about any one JadeKVM server. Pick the city for your audience, then follow the same steps. The page [Hong Kong, Tokyo or Singapore](https://jadekvm.com/hong-kong-tokyo-or-singapore-vps/ "Should I pick a Hong Kong, Tokyo or Singapore VPS?") compares the three.

## How do you create the sudo user and test it?

**Create the account as root, copy root's key file to it, then log in as that user from a new window.** If you pasted a key at checkout, root already holds it in `/root/.ssh/authorized_keys`. Copying that file saves a step. If you have no key yet, read [how to create an SSH key for a VPS](https://jadekvm.com/guides/how-to-create-an-ssh-key-for-a-vps/ "How do you create an SSH key for a VPS?") first.

Replace `mei` with your own user name. The last command must print root. If it does, the account can run admin tasks and you can close root's door safely.

*Create mei with root's key (run as root)*

```bash
apt update && apt full-upgrade -y
adduser mei
usermod -aG sudo mei
install -d -m 700 -o mei -g mei /home/mei/.ssh
install -m 600 -o mei -g mei /root/.ssh/authorized_keys /home/mei/.ssh/authorized_keys
# from your own computer, in a second window:
ssh mei@203.0.113.10
sudo whoami
```

## How do you block root and password login without locking yourself out?

**Put two lines in a file whose name sorts before 50-cloud-init.conf, test the syntax, then reload.** OpenSSH keeps the first value it reads for each keyword. Cloud images often ship a file that turns passwords back on, so a low number wins.

`sshd -t` prints nothing when the file is valid. `sshd -T` shows the values in force. The service is named ssh on both Debian 13 and Ubuntu 24.04. Keep your old window open and test a fresh login before you log out.

*Keys only, no root login*

```bash
sudo tee /etc/ssh/sshd_config.d/05-lockdown.conf > /dev/null <<'EOF'
PermitRootLogin no
PasswordAuthentication no
KbdInteractiveAuthentication no
EOF
sudo sshd -t
sudo sshd -T | grep -Ei '^(permitrootlogin|passwordauthentication)'
sudo systemctl reload ssh
```

## Which ports should a Linux VPS keep open in 2026?

**Only SSH, plus 80 and 443 when you run a website; everything else stays closed.** The guide on [how to set up a UFW firewall on a VPS](https://jadekvm.com/guides/how-to-set-up-a-ufw-firewall-on-a-vps/ "How do you set up a UFW firewall on a VPS?") walks through rules, limits and logs. Then add [fail2ban](https://jadekvm.com/guides/how-to-install-fail2ban-on-a-vps/ "How do you install fail2ban on a VPS?") for the SSH journal.

Outbound mail is a separate case. Outbound port 25 is closed on every server; send mail through a mail provider on port 465 or 587. This blocks a hijacked server from sending spam on its own.

*Firewall, fail2ban and auto updates*

```bash
sudo apt install -y ufw fail2ban python3-systemd unattended-upgrades
sudo ufw allow OpenSSH
sudo ufw enable
sudo systemctl enable --now fail2ban
sudo dpkg-reconfigure -plow unattended-upgrades
sudo ss -tlnp
```

## What does JadeKVM handle, and what stays your job?

**JadeKVM delivers a clean image with your key; patching, firewall rules and backups are yours.** Root signs in over SSH. A public key pasted at checkout is installed and password login stays disabled; with no key, the team sets a temporary root password, shown in the dashboard, to replace with passwd on first login. Reboot, reinstall and delete requests are sent from the dashboard and carried out by a person; a reinstall wipes the disk. No plan includes backups; daily backups kept 7 days can be added at checkout for 15% of the plan price. Without them, keep a copy of important data somewhere other than the server.

If a reinstall is ever needed, the dashboard form takes a new public key, so a lost key does not mean a lost server. The disk is wiped, though. That is one more reason to keep copies elsewhere.

## Questions about securing a Linux VPS

### What is the best first step to secure a Linux VPS?

Install updates, then make sure an SSH key works. Those two steps remove the most common ways in. On a JadeKVM server, a key pasted at checkout already keeps password login off.

### Which firewall is best on Ubuntu 24.04: UFW or nftables?

UFW is the easier choice for one server. It writes the rules for you and ships in Ubuntu. Raw nftables suits people who need complex rule sets.

### Should I change the SSH port in 2026?

It cuts log noise but does not stop a real attacker. Keys only and fail2ban matter more. If you change it, allow the new port in UFW before you reload SSH.

### What if I lock myself out of SSH?

Write to JadeKVM support, or request a reinstall from the dashboard with a new public key. A reinstall erases the disk, so test every SSH change in a second window first.

### Does a Linux VPS need antivirus?

Rarely. Updates, keys only and a firewall cover the real risks. Scan uploads only if you host files from untrusted users.

**Verdict**

- **Do all 8 steps on day one**: updates, sudo user, keys only, no root, UFW, fail2ban, auto updates and a port check.
- A key pasted at JadeKVM checkout closes the most attacked door before the server even boots.
- Security steps do not depend on the city: choose Hong Kong, Tokyo or Singapore for latency, then harden the same way.

## Sources

1. [Security, Ubuntu Server documentation](https://documentation.ubuntu.com/server/how-to/security/) — Canonical (read 2026-11-16)
2. [sshd_config(5) manual page](https://man.openbsd.org/sshd_config) — OpenBSD / OpenSSH (read 2026-11-16)
3. [Firewalls, Ubuntu Server documentation](https://documentation.ubuntu.com/server/how-to/security/firewalls/) — Canonical (read 2026-11-16)
4. [Fail2ban project and documentation](https://github.com/fail2ban/fail2ban) — Fail2ban (read 2026-11-16)
5. [Automatic updates, Ubuntu Server documentation](https://documentation.ubuntu.com/server/how-to/software/automatic-updates/) — Canonical (read 2026-11-16)
6. [UnattendedUpgrades, Debian Wiki](https://wiki.debian.org/UnattendedUpgrades) — Debian (read 2026-11-16)
7. [WonderNetwork: pings from Hong Kong](https://wondernetwork.com/pings/Hong%20Kong) — WonderNetwork (read 2026-11-16)

**Start from a server that already has your key** Paste the public key at checkout and password login stays off. Bead costs $3.75 a month on 12 months. [Order Bead in Hong Kong](https://jadekvm.com/app/checkout/?plan=bead&term=12m&location=hk-hkg&from=how-to-secure-a-linux-vps-in-hong-kong-tokyo-or-singapore&lang=en) · [See every plan](https://jadekvm.com/pricing/ "How much does a JadeKVM server cost per month?")

---

JadeKVM: JadeKVM sells Linux KVM VPS in Hong Kong, Tokyo and Singapore, paid in crypto with no ID document, and publishes the measured latency from each city to the rest of Asia. 5 plans from 1 to 16 GB of RAM cost the same in all three cities and, on the 12-month term, sit at least 25% under a named comparable no-KYC crypto plan read on 16 November 2026. The operator is DomaineGoat LLC, Panama.
