59 lines
1.7 KiB
Markdown
59 lines
1.7 KiB
Markdown
# 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
|
|
|
|
- Updates the package manager and upgrades installed packages.
|
|
- Sets the system timezone.
|
|
- Changes the hostname of the machine.
|
|
- Updates the `/etc/hosts` file with the machine's IP address and hostname.
|
|
- Modifies SSH configuration for better security:
|
|
- Disables root login.
|
|
- Disables password authentication.
|
|
- Ensures IPv4 address family is not commented out.
|
|
- Optionally installs Docker 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, please install it using your package manager).
|
|
|
|
## Usage
|
|
|
|
1. **Clone the repository:**
|
|
|
|
```bash
|
|
git clone https://git.nickhepler.cloud/nick/RHELSecureSetup.git
|
|
cd RHELSecureSetup
|
|
```
|
|
|
|
2. **Make the script executable**:
|
|
|
|
```bash
|
|
chmod +x setup.sh
|
|
```
|
|
|
|
3. **Run the script with root privileges**:
|
|
|
|
```bash
|
|
sudo ./setup.sh
|
|
```
|
|
|
|
4. **Follow the prompts**:
|
|
- Enter your public SSH key when prompted.
|
|
- 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 time zone.
|
|
|
|
## License
|
|
|
|
This project is licensed under the GPL-3.0 License. See the [LICENSE](LICENSE) file for more details.
|
|
|
|
## Acknowledgments
|
|
|
|
- Inspired by the documentation from Akamai (formerly Linode) for [setting up and securing compute instances](https://techdocs.akamai.com/cloud-computing/docs/set-up-and-secure-a-compute-instance). |