RHELSecureSetup is a Bash script designed to streamline the process of securing RHEL-based Linux distributions. By automating system updates and security configurations, it helps ensure that your instance is protected from vulnerabilities.
Go to file
2024-10-11 22:58:38 -04:00
LICENSE Initial commit 2024-10-10 15:37:04 -04:00
README.md Update README. 2024-10-11 22:58:38 -04:00
setup.sh Add update_hosts_file funtion to update hosts file. 2024-10-11 21:59:41 -04:00

RHELSecureSetup

This Bash script is designed for RHEL-based Linux distributions. It automates the process of updating the system, configuring security settings, and optionally installing Docker CE.

Features

  • System Updates: Updates the package manager and upgrades installed packages.
  • Timezone Configuration: Sets the system timezone.
  • Hostname Change: Changes the hostname of the machine.
  • Hosts File Update: Updates the /etc/hosts file with the machine's IP address and hostname.
  • SSH Security Enhancements:
    • Disables root login.
    • Disables password authentication.
    • Ensures IPv4 address family is explicitly set.
  • Optional Docker Installation: Installs Docker CE using the official installation script.

Prerequisites

  • A RHEL-based Linux distribution (e.g., CentOS, Fedora).
  • Root access or sudo privileges.
  • dnf or yum package manager.
  • curl installed (if not present, install it using your package manager).

Usage

  1. Clone the repository:

    git clone https://git.nickhepler.cloud/nick/RHELSecureSetup.git
    cd RHELSecureSetup
    
  2. Make the script executable:

    chmod +x setup.sh
    
  3. Run the script with root privileges:

    sudo ./setup.sh
    
  4. Follow the prompts:

    • Enter the desired hostname and timezone.
    • Provide a username and password for a new limited user account.
    • Optionally, choose whether to install Docker CE at the end of the script.

Customization

  • Time Zone: Modify the timezone variable in the script to set your desired timezone.
  • Hostname: The script prompts for a hostname during execution, but you can also set a default value in the script.

License

This project is licensed under the GPL-3.0 License. See the LICENSE file for more details.

Acknowledgments