Skip to content

tdiprima/Server-Fortress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hardening a new Linux server is tedious and error-prone — SSH config, firewall rules, auto-updates, brute-force protection. Easy to miss a step; easy to lock yourself out.

Fortify is an interactive bash script that walks you through safe, step-by-step server hardening on Ubuntu/Debian and RHEL/Rocky/Alma. It backs up configs before touching them, validates SSH config before restarting, and prompts before every change.

Covers:

  • SSH hardening (port, key-only auth, AllowUsers, PermitRootLogin)
  • Firewall setup (UFW or firewalld)
  • Automatic security updates
  • Fail2ban for SSH brute-force blocking
  • Lynis security audit tool

Example Output

Safe Linux Server Hardening
------------------------------------------------
✅ Detected OS family: debian
✅ Detected SSH service: ssh

Step 1 — Choose your settings
Admin username to ensure exists [user]:
SSH port [22]: 2222
...
✅ sshd_config validated OK
✅ Restarted ssh
✅ UFW enabled
🎉 Fortify complete

Installation

git clone https://github.com/tdiprima/Server-Fortress.git
cd Server-Fortress

Usage

sudo bash src/fortify.sh

For RHEL/Rocky/Alma:

sudo bash src/fortify-rhel.sh

Use without firewall setup:

sudo bash src/fortify-no-firewall.sh

⚠️ Disclaimer

This script makes system-level security changes including SSH configuration, firewall rules, user accounts, and update settings. While it includes safeguards (backups, validation checks, and interactive prompts), you are responsible for reviewing changes before applying them to any system.

Use at your own risk. The author is not liable for:

  • Loss of access to a server
  • Service disruption or downtime
  • Misconfiguration in custom or non-standard environments
  • Etc.

Always test on a non-production system first and verify SSH access in a new session before closing your current one.


About

Interactive bash script for safe, step-by-step Linux server hardening — SSH, firewall, Fail2ban, and auto-updates on Ubuntu/RHEL.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages