Before you start
- VM is
active— see Create a VM - You can SSH in as
root(or you’ve added an SSH key in the create flow) - An SSH public key on your local machine for the new user
1. Connect as root
2. Update the system
Get the latest security patches before doing anything else. Ubuntu / Debian:3. Create a non-root user with sudo
Running asroot over SSH is a known-bad practice. Create a real user and give it sudo.
Ubuntu / Debian:
4. Copy your SSH public key to the new user
From your local machine (not the VM):ssh-copy-id isn’t available, do it manually on the VM:
5. Lock down SSH
Edit/etc/ssh/sshd_config:
systemctl restart if reload doesn’t pick up changes):
6. Set up a firewall
Define a default-deny inbound policy and explicitly allow what you need. Ubuntu / Debian — UFW:7. Confirm automatic security updates
Raff Ubuntu and Debian images ship withunattended-upgrades enabled for the security pocket. Confirm it is on:
dnf-automatic:
8. Confirm fail2ban
Raff Ubuntu and Debian images ship withfail2ban and the sshd jail active (5 failures in 10 minutes → 10 minute ban). Check it and see who has been knocking:
/etc/fail2ban/jail.local if you want longer ban times. On the RHEL family install it yourself:
9. Set the timezone (optional)
10. Reboot
If the kernel updated in step 2 (or if you’re paranoid about pending changes):raff and confirm everything’s still working.
You’re done — checklist
- System fully patched
- Non-root user with sudo and SSH key login
- Root SSH login disabled
- Password SSH login disabled
- Firewall enabled with default-deny inbound
- Automatic security updates running
- fail2ban running (preinstalled on Raff Ubuntu/Debian images)
- (Optional) sensible timezone
Next steps
Firewall
Tighten the platform-level firewall to match your OS firewall.
Enable backups
Schedule daily or weekly backups before going live.
Monitoring & metrics
Read your VM’s CPU/RAM/network from the dashboard.
Recover a locked-out VM
What to do if the firewall or SSH config locks you out.