HaltOS

Secure a VPS for remote development: SSH keys, ufw and RDP

A development VPS holds your code, your tokens and often your cloud credentials, and it is reachable from the whole internet. A few defaults make it a far smaller target. This is what claude-code-vps sets up, and why.

Keys only for SSH

Password logins are what automated scanners try all day. Turning them off removes the whole class of attack. claude-code-vps writes a small drop-in instead of editing the main config:

# /etc/ssh/sshd_config.d/10-claude-vps.conf
PasswordAuthentication no
KbdInteractiveAuthentication no
PermitRootLogin prohibit-password

It validates the config with sshd -t before reloading, so a typo cannot lock you out, and it copies the root account's authorized keys to your new sudo user so you can log in as that user straight away.

A firewall that denies by default

ufw starts by allowing nothing in and everything out. Only what you need gets opened:

ufw allow OpenSSH
ufw allow 53389/tcp comment 'xrdp'
ufw --force enable

Remote desktop runs on a custom port rather than 3389. That does not make it secure on its own, but it keeps the logs free of the endless 3389 scans.

Keep RDP closed if you can

The safest RDP port is a closed one. With --rdp-private, the RDP port stays shut and you reach the desktop through an SSH tunnel instead:

ssh -L 3389:localhost:53389 dev@your-server

Then point your RDP client at localhost:3389. Everything travels inside SSH, protected by your key.

Updates without thinking about them

Security fixes only help once they are installed. unattended-upgrades applies them automatically. On HaltOS, the SSH login banner also shows how many updates are pending and how many of them are security updates, so you notice when a reboot is due.

Secrets stay out of git

If you sync your config from a git repository, make sure credentials never end up in it. claude-code-vps only captures files listed in a manifest, never takes the Claude credentials, SSH keys or wallet files, and skips binary files entirely. More on that in keeping dotfiles in git without leaks.

All posts Next: KDE Plasma over RDP on a VPS with xrdp