vps-security-hardening — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited vps-security-hardening (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Audit and harden VPS security with fail2ban (brute-force protection), SSH hardening, and optional firewall setup.
Before hardening, ensure you can SSH into the VPS.
VPS providers often disable password auth by default. You need to add your SSH key first.
#### Option 1: Via VPS Web Console (Recommended)
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -N '' -C "user@machine"
cat ~/.ssh/id_ed25519.pub mkdir -p ~/.ssh
echo "ssh-ed25519 AAAA... user@machine" >> ~/.ssh/authorized_keys
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys ssh root@VPS_IP#### Option 2: Via Provider Dashboard
Most providers (DigitalOcean, Vultr, Biznet, etc.) have "Add SSH Key" in dashboard:
cat ~/.ssh/id_ed25519.pub)#### Option 3: Enable Password Auth Temporarily
Only if web console is unavailable:
echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config.d/99-temp-password.conf
systemctl reload sshd rm /etc/ssh/sshd_config.d/99-temp-password.conf
systemctl reload sshdProblem: sshpass -p 'password' ssh user@host fails with "Permission denied (publickey)" even with correct password.
Why: VPS has PasswordAuthentication no in sshd_config — password auth is disabled at server level.
Solution: Use web console to add SSH key first (see Option 1 above).
ps aux --sort=-%mem | head -20
systemctl list-units --type=service --state=running sudo ss -tulpn
sudo netstat -tulpn # Hidden processes
ps aux | wc -l
ls /proc | grep -E '^[0-9]+$' | wc -l
# Recent failed logins
sudo grep "Failed password" /var/log/auth.log | tail -20 cat /etc/passwd | grep -E '/bin/(bash|sh)$'
sudo lastlog free -h
df -h
uptime# Install
sudo apt-get update
sudo apt-get install -y fail2ban
# Enable and start
sudo systemctl enable fail2ban
sudo systemctl start fail2banCreate /etc/fail2ban/jail.local:
[DEFAULT]
bantime = 3600 # Ban for 1 hour
findtime = 600 # Count failures in last 10 minutes
maxretry = 5 # Ban after 5 failures
[sshd]
enabled = true
port = 22
logpath = /var/log/auth.log
maxretry = 5Restart:
sudo systemctl restart fail2ban
sudo fail2ban-client status sshdCreate /etc/ssh/sshd_config.d/99-hardening.conf:
# Disable root login
PermitRootLogin no
# Enable public key auth
PubkeyAuthentication yes
# Disable empty passwords
PermitEmptyPasswords no
# Limit auth attempts
MaxAuthTries 3
# Disable X11 forwarding
X11Forwarding no
# Disable TCP forwarding
AllowTcpForwarding no
# Disable agent forwarding
AllowAgentForwarding no
# Set login grace time
LoginGraceTime 30
# Limit sessions
MaxSessions 2
# Strong ciphers only
Ciphers [email protected],[email protected],[email protected]
# Strong MACs only
MACs [email protected],[email protected]
# Strong key exchange
KexAlgorithms curve25519-sha256,diffie-hellman-group-exchange-sha256Test and reload:
sudo sshd -t
sudo systemctl reload sshd# fail2ban status
sudo fail2ban-client status sshd
# SSH config
sudo sshd -T | grep -E '(permitrootlogin|maxauthtries|x11forwarding)'
# Check banned IPs
sudo fail2ban-client get sshd banipDO NOT automatically disable password authentication!
# Check if user has SSH keys
cat ~/.ssh/authorized_keys
# Check how user is currently connected
sudo grep "Accepted" /var/log/auth.log | tail -5If user logs in with PASSWORD:
PasswordAuthentication yesIf user logs in with SSH KEY:
PasswordAuthentication noCRITICAL: If user says "keep password" or "tanpa ssh key" or similar:
User knows their use case better than you:
Problem: User currently uses password, you disable it, user gets locked out.
Solution:
Problem: Invalid SSH config breaks SSH service, user locked out.
Solution:
sudo sshd -t before reloadreload not restart (preserves current connections)Problem: User makes typo 5 times, gets banned.
Solution:
sudo fail2ban-client unban --allProblem: User made decision (e.g., keep password), you keep suggesting alternatives.
Solution:
Problem: Deleting cloud provider system users (e.g., lighthouse on Tencent Cloud).
Solution:
sudo grep lighthouse /etc/sudoers.d/*# Check fail2ban status
sudo fail2ban-client status sshd
# Check banned IPs
sudo fail2ban-client get sshd banip
# Unban IP
sudo fail2ban-client set sshd unbanip 1.2.3.4
# Watch SSH attacks live
sudo journalctl -u ssh -f
# Recent failed attempts
sudo grep "Failed password" /var/log/auth.log | tail -20Only enable if user requests or if no cloud-level firewall exists.
# Allow SSH first (CRITICAL!)
sudo ufw allow 22/tcp
# Allow other services
sudo ufw allow 1430/tcp # Example: API port
# Enable
sudo ufw enable
# Check status
sudo ufw statusreferences/ssh-key-vs-password.md — Detailed comparison and decision framework~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.