Security Hardening of a Virtualmin Server for Associations: The Practical Checklist
Protect your Virtualmin server with our practical checklist: SSH keys, Fail2ban, firewall, automatic updates, backup encryption, and two-factor authentication. This is how you fend off the most common attacks.
Why security hardening is especially important for associations
Associations often run servers with sensitive member data, donation information, or internal communication platforms. At the same time, the necessary budget for professional security teams is often lacking. An unhardened Virtualmin server is an easy target for attackers. This checklist shows you how to eliminate the most common attack vectors with simple means.
1. SSH keys instead of passwords
Password-based SSH logins are vulnerable to brute-force attacks. Switch to key authentication and disable passwords.
- Generate key pair:
ssh-keygen -t ed25519 -a 100(on your local machine). - Copy public key to the server:
ssh-copy-id user@server. - Adjust SSH configuration: In
/etc/ssh/sshd_configsetPasswordAuthentication no,PermitRootLogin no, andPubkeyAuthentication yes. - Restart SSH service:
systemctl restart sshd.
Test the login in a new session before closing the old one!
2. Fail2ban against brute-force
Fail2ban monitors logs and blocks IPs after failed login attempts. Install it via the package manager and enable the SSH jail.
- Installation:
apt install fail2ban(Debian/Ubuntu) oryum install fail2ban(CentOS). - Configure jail: Create
/etc/fail2ban/jail.localwith[sshd] enabled = trueand adjustmaxretry,bantime. - For Virtualmin: Also enable jails for Postfix, Dovecot, and Apache/Nginx.
3. Firewall rules with Firewalld or UFW
A restrictive firewall is mandatory. Allow only required ports (SSH, HTTP, HTTPS, possibly mail).
- UFW (Ubuntu):
ufw allow 22/tcp,ufw allow 80/tcp,ufw allow 443/tcp, thenufw enable. - Firewalld (CentOS):
firewall-cmd --permanent --add-service={ssh,http,https}andfirewall-cmd --reload. - Virtualmin-specific: Open port 10000 for the Control Panel only from trusted IPs.
4. Set up automatic updates
Regular updates close security gaps. Configure unattended updates for the operating system and Virtualmin.
- Debian/Ubuntu:
apt install unattended-upgradesand enable it withdpkg-reconfigure --priority=low unattended-upgrades. - CentOS:
yum install yum-cronand start the service. - Virtualmin: Under Webmin > System > Software Package Updates you can enable automatic updates for Virtualmin packages.
5. Backup encryption
Backups often contain sensitive data. Encrypt them before outsourcing.
- Virtualmin backups: Enable the Encryption option and choose GPG. Keep the key safe.
- Manual backups: Use
tar -czf - /directory | gpg -c > backup.tar.gz.gpg. - Storage location: Store backups on an external server or cloud storage with strong authentication.
6. Two-factor authentication (2FA)
Protect Virtualmin and SSH with 2FA to defuse stolen passwords.
- For Virtualmin/Webmin: Install the Two-Factor Authentication module and configure it with TOTP (e.g., Google Authenticator).
- For SSH: Install
libpam-google-authenticator, configure PAM, and setAuthenticationMethods publickey,passwordin the SSH configuration.
Conclusion: More security with simple steps
Implementing this checklist significantly reduces the attack surface of your Virtualmin server. For associations with limited resources, it is advisable to use professional web hosting or virtual servers that are already hardened. Also remember regular security audits and keep your software up to date. If you have any questions, our support is happy to help.

