Contains scripts for managing SSH and GPG keys, including backup, restoration, security hardening, and brute force protection.
- Backup and restore SSH and GPG keys
- Harden SSH configuration
- Usage:
./key-util.sh {backup|restore|harden-ssh}
- Configure fail2ban to prevent SSH brute force attacks
- Set up SSHD jail with custom configuration
- Usage:
./fail2ban.sh
- Disables password authentication
- Disables challenge-response authentication
- Enables public key authentication only
- Changes default SSH port (configurable)
- Monitors SSH login attempts
- Bans IP addresses after 3 failed attempts
- 10-minute ban time
- Configurable via jail.local
-
Make scripts executable:
chmod +x key-util.sh fail2ban.sh
-
Run key-util.sh:
./key-util.sh backup # Backup SSH and GPG keys ./key-util.sh restore # Restore SSH and GPG keys ./key-util.sh harden-ssh # Harden SSH configuration
-
Run fail2ban.sh:
./fail2ban.sh # Configure and start fail2ban
- Linux system
- sudo privileges
- fail2ban (will be installed by fail2ban.sh)
- SSH and GPG installed