Operations 19 min read

All‑In‑One Linux System Initialization Scripts for Rocky, AlmaLinux, CentOS, Ubuntu, Debian & More

This article introduces a collection of shell scripts that automate system initialization across dozens of Linux distributions—including Rocky, AlmaLinux, CentOS, Ubuntu, Debian, openEuler, AnolisOS, OpenCloudOS, openSUSE, Kylin Server and UOS Server—detailing supported features, version‑specific OS compatibility, usage instructions, changelogs, and troubleshooting tips.

Raymond Ops
Raymond Ops
Raymond Ops
All‑In‑One Linux System Initialization Scripts for Rocky, AlmaLinux, CentOS, Ubuntu, Debian & More

Linux System Initialization Scripts

The repository provides a set of shell scripts for quickly configuring newly installed Linux servers. The source code is hosted on both Gitee and GitHub:

Gitee: https://gitee.com/raymond9/shell
Github: https://github.com/raymond999999/shell

These scripts can be pulled from the repositories and executed as root.

Supported Functions

Rename network interfaces (except openSUSE, which already uses eth0/eth1).

Configure network settings, including IP address, netmask, gateway and DNS for single or dual NICs.

Set hostname.

Configure repository mirrors (not required for Kylin Server and UOS Server).

Install minimal recommended packages.

Disable firewalls (ufw on Ubuntu, firewalld on most other distros).

Disable SELinux (not present on Ubuntu, Debian, openSUSE).

Disable AppArmor (only openSUSE needs this).

Disable swap.

Set system timezone.

Optimize resource limits and kernel parameters.

Optimize SSH configuration and change the SSH port.

Set system aliases, PS1 prompt, vimrc, default editor, history format, and other user‑level preferences.

Install and configure a mail service.

Enable or disable Ctrl+Alt+Del reboot, root login for Ubuntu/Debian, and uninstall unnecessary packages or snap on Ubuntu.

Version‑Specific OS Support

The scripts are packaged for multiple releases:

v10: Rocky Linux 8/9/10, AlmaLinux 8/9/10, CentOS 7, CentOS Stream 8/9/10, Ubuntu Server 18.04/20.04/22.04/24.04 LTS, Debian 11/12/13.

openEuler: 22.03/24.03 LTS.

AnolisOS: 8/23.

OpenCloudOS: 8/9.

openSUSE Leap 15.

Kylin Server: V10/V11.

UOS Server: V20.

Each version has its own script directory (e.g., reset_v10, reset_openeuler, etc.) with the appropriate repository URLs.

Changelog Highlights

Added traditional NIC names (eth0, eth1) for newer Rocky, AlmaLinux and CentOS Stream releases.

Switched from nmcli to configuration‑file based IP setting to accommodate changed naming rules.

Adjusted GRUB configuration handling for UEFI systems.

Improved Ubuntu/Debian IP configuration and fixed post‑reboot IP reset bugs.

Extended support to Rocky/AlmaLinux 10, Debian 13, Kylin Server V11, UOS Server V20, and other newer releases.

Fixed numerous bugs related to swap disabling, Ctrl+Alt+Del handling, PS1 prompt, and repository management.

Important Usage Notes

Run the script as the root user. Ubuntu and Debian require enabling root login first.

Install lrzsz to transfer the script, then execute with bash reset_*.sh.

The interactive menu offers 26 options covering all supported features; select the desired number and follow on‑screen prompts.

When configuring CentOS Stream 9/10 repositories, ensure the accompanying update_mirror.pl script is present in the same directory.

reset script illustration
reset script illustration
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

AutomationLinuxshell scriptSystem InitializationOS setup
Raymond Ops
Written by

Raymond Ops

Linux ops automation, cloud-native, Kubernetes, SRE, DevOps, Python, Golang and related tech discussions.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.