npx skills add ...
npx skills add tibobfd/skills-secure-vps-for-beginners --skill secure-vps-setup
Expert Security Mentor. Guides users step-by-step to secure a Linux VPS (Hardening, Tailscale, Traefik, Crowdsec).
npx skills add tibobfd/skills-secure-vps-for-beginners --skill secure-vps-setup
sudo access.-> Read references/security-concepts.md for detailed concepts.
Goal: Secure the Operating System foundation before exposing anything.
Goal: Replace weak passwords with cryptographic keys.
ssh user@your-vps-ip. It should NOT ask for a password (or only ask for the key passphrase)./etc/ssh/sshd_config:
Goal: Hide management ports from the public internet entirely.
tailscale ip -4ssh user@100.x.y.z⚠️ SAFETY NET: Ensure you have access to your VPS Provider's "Web Console" or "KVM" (e.g., OVH/Hetzner panel). If Tailscale fails, that is your only way back in!
Goal: Run applications with automated updates.
~/app-data/traefik.
CRITICAL PREPARATION:
Traefik requires strict permissions for the certificate file.
~/app-data/watchtower/docker-compose.yml and deploy.Goal: Ban malicious IPs automatically.
Method A: Host Installation (Recommended) Best for protecting the server itself (SSH, System logs) and managing the Firewall directly.
Install Crowdsec:
Install Firewall Bouncer:
This connects Crowdsec directly to your UFW/IPtables to drop packets.
Connect Traefik Logs (Crucial): Crowdsec needs to see Traefik's logs to stop web attacks.
/etc/crowdsec/acquis.yaml:
sudo systemctl restart crowdsecSetup Notifications (Optional but Recommended): Get alerted on Discord when an IP is banned.
sudo nano /etc/crowdsec/notifications/discord.yaml
/etc/crowdsec/profiles.yaml and add discord_default under notifications:.sudo systemctl restart crowdsecMethod B: Docker Installation (Alternative) Use if you want full container isolation.
~/app-data/crowdsec.Goal: Ensure resilience and recoverability.
Strategy: Hybrid Architecture (Recommended) Critical infrastructure (Security, Backup, VPN) runs on the Host for reliability. Apps run in Docker.
Vulnerability Scan (Trivy):
Backups (Duplicati): Method A: Host Installation (Robust) Best for disaster recovery (can restore Docker configs even if Docker is down).
--webservice-interface=100.x.y.zMethod B: Docker Installation
-> Copy config from references/docker-compose-templates.md
Edit the file and replace 127.0.0.1 with your Tailscale IP.
Deploy in ~/app-data/duplicati.
Final Check:
-> Run scripts/verify_setup.sh