SSH hardening on a VPS
Lock down SSH on your VPS: switch to key only login, disable root and passwords with a drop in config, and layer Fail2ban and a VPN on top.
Filtering by topic #hardening · clear
Lock down SSH on your VPS: switch to key only login, disable root and passwords with a drop in config, and layer Fail2ban and a VPN on top.
ProtectSystem, PrivateTmp, DynamicUser and NoNewPrivileges explained: what each directive blocks, what it breaks, and how to debug a unit that stops starting.
Open SearXNG to other people safely: bind to localhost, align forwarded IP headers with trusted proxies, enable the limiter, and lock down the JSON API.
What a fresh k3s install leaves open on a VPS: port 6443, the kubelet on 10250, kubeconfig mode, NodePorts that can bypass ufw, and privileged pods.
What nosuid, nodev and noexec really stop on a Linux VPS, the fstab and bind mount entries for /tmp, /var/tmp, /dev/shm and /home, and what breaks.
A new VPS is a target from its first minute. This ten minute runbook creates a user, sets SSH keys, disables root, and turns on the firewall.
Shell history is not an audit trail. Compare sudo logging, session recording, shell hooks and auditd execve rules, then ship the logs off the box.
The first hour on a Rocky Linux or AlmaLinux VPS: dnf updates, a wheel user, key only SSH, firewalld, automatic updates, and SELinux left enforcing.
Vaultwarden encrypts vault contents in the client, but stores account metadata in plaintext. The real risks are your admin token and your backup file.
OpenSSH negotiates hybrid key exchange by default. Check what your Ubuntu box really uses, and where post quantum host keys are now available.
Claude Code can run any command your user can. What the skip permissions flag changes, and how to contain the blast radius, from sandbox to disposable VPS.
Log in to your VPS with a hardware security key. Enrol a spare key first, test it in a second session, then make sshd demand a touch and a PIN on every login.
OpenClaw runs shell commands and browses the web, so a careless setup is dangerous. Harden it on a VPS: unprivileged user, firewall, secrets, systemd.
Agent Zero runs code, a browser, and a shell from a Web UI, so exposing it carelessly is dangerous. Set it up on a VPS and lock the Web UI down.
An agent holding your API keys can leak them in one tool call. Give it scoped short lived tokens behind a credential gateway, never the real keys.
OpenHands is an AI agent that writes and runs code, so its setup needs care. Install it on a VPS with Docker and lock down the Web UI and its secrets.
Ubuntu Server 24.04 ships unattended-upgrades, but 20auto-upgrades turns it on. Automatic-Reboot stays false, and a dry run shows what it would install.
Running a service as root turns one bug into full server access. Give each service its own unprivileged account, or let systemd do it with DynamicUser.