π§± Basic VPS Hardening for Node Operators β
Before running any validator node, it's important to ensure your VPS is secure and properly configured. This guide provides a checklist and links to individual setup steps that will help you build a strong foundation.
1. Use SSH Key Authentication β
Disable password-based logins and use SSH keys instead. This is one of the most effective ways to protect against brute-force attacks.
2. Disable Root Login (Safely) β
Once a non-root user with SSH key access is working, disable direct root login to reduce exposure.
π Disable Root Login
3. Enable UFW Firewall β
Limit access to only the ports your validator needs (e.g., P2P, RPC). Deny all other incoming traffic by default.
π Set up UFW Firewall
4. Protect SSH with Fail2Ban β
Fail2Ban bans IPs that show signs of brute-force behavior, adding another layer of protection to your login system.
π Set up Fail2Ban
5. Remove Unused Packages β
Less software = less surface area for attack. Remove services and tools you donβt use:
Example (only run if you're not using them):
# Optional: remove Apache web server
sudo apt remove --purge apache2 -y
# Optional: remove Snap daemon (not commonly used on servers)
sudo apt remove --purge snapd -y
# Clean up unused dependencies
sudo apt autoremove -y
6. Check Running Services β
List and stop any unnecessary services:
sudo systemctl list-units --type=service
To disable a service:
sudo systemctl disable service-name
sudo systemctl stop service-name
7. (Optional) Disable IPv6 β
If youβre not using IPv6, disable it to reduce exposure:
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
To make it persistent, add to /etc/sysctl.conf
:
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
8. Sync Server Time (NTP) β
Ensure your server time is accurate for logs and node operations:
sudo timedatectl set-ntp true
timedatectl status
9. Enable Automatic Security Updates β
(Optional, but helpful)
sudo apt install unattended-upgrades -y
sudo dpkg-reconfigure --priority=low unattended-upgrades
Built by Node Runners.
For the Networks We Believe In.
π astrostake.xyz