A set of Bash scripts to automate the hardening of Ubuntu Linux systems, making them safer and more secure with minimal effort. Perfect for beginners learning system administration or cybersecurity.
- 🔒 Disable root login via SSH and 🔓 Enable root login
- 🔥 Install and configure UFW firewall
- 📦 Enable automatic system updates
- 👤 Create secure, limited-privilege user accounts
- disable-root-ssh.sh # Disable root SSH access
- enable-root-ssh.sh # Enable root SSH access
- enable_ufw.sh # Enable and configure firewall
- auto-update.sh # Auto-update installed packages
- create-user.sh # Create a new user with sudo access
- README.md # This file
- Ubuntu based Linux machine
sudoprivileges- Internet access
- Basic familiarity with the terminal
- Clone this repository:
git clone https://github.com/Anwesa-s/linux-secure-scripts.git
cd linux-secure-scripts- Make all scripts executable:
chmod +x *.sh- Run each scripts:
sudo ./disable-root-ssh.sh
sudo ./enable-root-ssh.sh
sudo ./enable_ufw.sh
sudo ./auto-update-upgrade.sh
sudo ./user_make.sh💡 Pro tip: Always test scripts on a virtual machine before deploying to a real server.
disable-root-ssh.shDisables SSH login for the root user by modifying /etc/ssh/sshd_config, then restarts the SSH service.
1.1 enable-root-ssh.sh
Enables SSH login for the root via the backup file, then restart the SSH service.
-
enable_ufw.shInstalls UFW (Uncomplicated Firewall), sets secure default rules, and allows only SSH traffic. -
auto-update-upgrade.shUpdates and upgrades system packages using APT. Automate this with cron for regular updates. -
user_make.shPrompts for a username, creates a user, sets a password, and adds the user to the sudo group.
By completing this project, you'll learn:
✅ Bash scripting fundamentals
✅ Linux server hardening techniques
✅ Basic firewall configuration with UFW
✅ Secure user management