mirror of
https://github.com/buildplan/du_setup.git
synced 2025-12-17 17:55:35 +00:00
Merge pull request #48 from buildplan/deb_13
Debian 13 tested and confirmed compatibility.
This commit is contained in:
commit
8e0585ea46
17
README.md
17
README.md
@ -1,19 +1,20 @@
|
|||||||
# Debian & Ubuntu Server Setup & Hardening Script
|
# Debian & Ubuntu Server Setup & Hardening Script
|
||||||
|
|
||||||
|
[](https://www.debian.org/releases/)
|
||||||
|
[](https://ubuntu.com/download/server)
|
||||||
[](https://github.com/buildplan/du_setup/actions/workflows/lint.yml)
|
[](https://github.com/buildplan/du_setup/actions/workflows/lint.yml)
|
||||||
[](https://opensource.org/licenses/MIT)
|
[](https://opensource.org/licenses/MIT)
|
||||||
[](https://www.debian.org/)
|
|
||||||
[](https://www.gnu.org/software/bash/)
|
[](https://www.gnu.org/software/bash/)
|
||||||
[](https://github.com/buildplan/du_setup)
|
[](https://github.com/buildplan/du_setup)
|
||||||
|
|
||||||
**Version:** v0.63
|
**Version:** v0.64
|
||||||
|
|
||||||
**Last Updated:** 2025-08-10
|
**Last Updated:** 2025-08-15
|
||||||
|
|
||||||
**Compatible With:**
|
**Compatible With:**
|
||||||
|
|
||||||
* Debian 12
|
* Debian 12, 13
|
||||||
* Ubuntu 22.04, 24.04 (24.10 & 25.04 experimental)
|
* Ubuntu 20.04, 22.04, 24.04 (24.10 & 25.04 experimental)
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
@ -82,12 +83,12 @@ sha256sum du_setup.sh
|
|||||||
|
|
||||||
Compare the output hash to the one below. They must match exactly.
|
Compare the output hash to the one below. They must match exactly.
|
||||||
|
|
||||||
`200bec06b7eb818616fc8073e4aa479c2dd3aa8c262a2e273173d31cda0286a3`
|
`39dfc5716377b3468ecacd9f7a557fedca0397720c3652e5b14d8788241df789`
|
||||||
|
|
||||||
Or echo the hash to check, it should output: `du_setup.sh: OK`
|
Or echo the hash to check, it should output: `du_setup.sh: OK`
|
||||||
|
|
||||||
```
|
```
|
||||||
echo 200bec06b7eb818616fc8073e4aa479c2dd3aa8c262a2e273173d31cda0286a3 du_setup.sh | sha256sum --check -
|
echo 39dfc5716377b3468ecacd9f7a557fedca0397720c3652e5b14d8788241df789 du_setup.sh | sha256sum --check -
|
||||||
```
|
```
|
||||||
|
|
||||||
### 3\. Run the Script
|
### 3\. Run the Script
|
||||||
@ -177,7 +178,7 @@ After rebooting, verify the setup:
|
|||||||
|
|
||||||
## Tested On
|
## Tested On
|
||||||
|
|
||||||
* Debian 12
|
* Debian 12, 13
|
||||||
* Ubuntu 22.04, 24.04 - 24.10 & 25.04 (experimental)
|
* Ubuntu 22.04, 24.04 - 24.10 & 25.04 (experimental)
|
||||||
* Cloud providers: DigitalOcean, Oracle Cloud, OVH Cloud, Hetzner, Netcup
|
* Cloud providers: DigitalOcean, Oracle Cloud, OVH Cloud, Hetzner, Netcup
|
||||||
* Backup destinations: Hetzner Storage Box (SSH, port 23), custom SSH servers
|
* Backup destinations: Hetzner Storage Box (SSH, port 23), custom SSH servers
|
||||||
|
|||||||
18
du_setup.sh
18
du_setup.sh
@ -1,8 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Debian 12 and Ubuntu Server Hardening Interactive Script
|
# Debian and Ubuntu Server Hardening Interactive Script
|
||||||
# Version: 0.63 | 2025-08-10
|
# Version: 0.64 | 2025-08-15
|
||||||
# Changelog:
|
# Changelog:
|
||||||
|
# - v0.64: Tested at Debian 13 to confirm it works as expected
|
||||||
# - v0.63: Added ssh install in key packages
|
# - v0.63: Added ssh install in key packages
|
||||||
# - v0.62: Added fix for fail2ban by creating empty ufw log file
|
# - v0.62: Added fix for fail2ban by creating empty ufw log file
|
||||||
# - v0.61: Display Lynis suggestions in summary, hide tailscale auth key, cleanup temp files
|
# - v0.61: Display Lynis suggestions in summary, hide tailscale auth key, cleanup temp files
|
||||||
@ -63,7 +64,7 @@
|
|||||||
set -euo pipefail # Exit on error, undefined vars, pipe failures
|
set -euo pipefail # Exit on error, undefined vars, pipe failures
|
||||||
|
|
||||||
# --- Update Configuration ---
|
# --- Update Configuration ---
|
||||||
CURRENT_VERSION="0.63"
|
CURRENT_VERSION="0.64"
|
||||||
SCRIPT_URL="https://raw.githubusercontent.com/buildplan/du_setup/refs/heads/main/du_setup.sh"
|
SCRIPT_URL="https://raw.githubusercontent.com/buildplan/du_setup/refs/heads/main/du_setup.sh"
|
||||||
CHECKSUM_URL="${SCRIPT_URL}.sha256"
|
CHECKSUM_URL="${SCRIPT_URL}.sha256"
|
||||||
|
|
||||||
@ -124,7 +125,7 @@ print_header() {
|
|||||||
echo -e "${CYAN}╔═════════════════════════════════════════════════════════════════╗${NC}"
|
echo -e "${CYAN}╔═════════════════════════════════════════════════════════════════╗${NC}"
|
||||||
echo -e "${CYAN}║ ║${NC}"
|
echo -e "${CYAN}║ ║${NC}"
|
||||||
echo -e "${CYAN}║ DEBIAN/UBUNTU SERVER SETUP AND HARDENING SCRIPT ║${NC}"
|
echo -e "${CYAN}║ DEBIAN/UBUNTU SERVER SETUP AND HARDENING SCRIPT ║${NC}"
|
||||||
echo -e "${CYAN}║ v0.62 | 2025-08-06 ║${NC}"
|
echo -e "${CYAN}║ v0.64 | 2025-08-15 ║${NC}"
|
||||||
echo -e "${CYAN}║ ║${NC}"
|
echo -e "${CYAN}║ ║${NC}"
|
||||||
echo -e "${CYAN}╚═════════════════════════════════════════════════════════════════╝${NC}"
|
echo -e "${CYAN}╚═════════════════════════════════════════════════════════════════╝${NC}"
|
||||||
echo
|
echo
|
||||||
@ -362,11 +363,11 @@ check_system() {
|
|||||||
if [[ -f /etc/os-release ]]; then
|
if [[ -f /etc/os-release ]]; then
|
||||||
source /etc/os-release
|
source /etc/os-release
|
||||||
ID=$ID # Populate global ID variable
|
ID=$ID # Populate global ID variable
|
||||||
if [[ $ID == "debian" && $VERSION_ID == "12" ]] || \
|
if [[ $ID == "debian" && $VERSION_ID =~ ^(12|13)$ ]] || \
|
||||||
[[ $ID == "ubuntu" && $VERSION_ID =~ ^(20.04|22.04|24.04)$ ]]; then
|
[[ $ID == "ubuntu" && $VERSION_ID =~ ^(20.04|22.04|24.04)$ ]]; then
|
||||||
print_success "Compatible OS detected: $PRETTY_NAME"
|
print_success "Compatible OS detected: $PRETTY_NAME"
|
||||||
else
|
else
|
||||||
print_warning "Script not tested on $PRETTY_NAME. This is for Debian 12 or Ubuntu 20.04/22.04/24.04 LTS."
|
print_warning "Script not tested on $PRETTY_NAME. This is for Debian 12/13 or Ubuntu 20.04/22.04/24.04 LTS."
|
||||||
if ! confirm "Continue anyway?"; then exit 1; fi
|
if ! confirm "Continue anyway?"; then exit 1; fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
@ -660,6 +661,11 @@ setup_user() {
|
|||||||
|
|
||||||
configure_system() {
|
configure_system() {
|
||||||
print_section "System Configuration"
|
print_section "System Configuration"
|
||||||
|
|
||||||
|
# Warn about /tmp being a RAM-backed filesystem on Debian 13+
|
||||||
|
print_info "Note: Debian 13 uses tmpfs for /tmp by default (stored in RAM)"
|
||||||
|
print_info "Large temporary files may consume system memory"
|
||||||
|
|
||||||
mkdir -p "$BACKUP_DIR" && chmod 700 "$BACKUP_DIR"
|
mkdir -p "$BACKUP_DIR" && chmod 700 "$BACKUP_DIR"
|
||||||
cp /etc/hosts "$BACKUP_DIR/hosts.backup"
|
cp /etc/hosts "$BACKUP_DIR/hosts.backup"
|
||||||
cp /etc/fstab "$BACKUP_DIR/fstab.backup"
|
cp /etc/fstab "$BACKUP_DIR/fstab.backup"
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
200bec06b7eb818616fc8073e4aa479c2dd3aa8c262a2e273173d31cda0286a3 du_setup.sh
|
39dfc5716377b3468ecacd9f7a557fedca0397720c3652e5b14d8788241df789 du_setup.sh
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user