7da9688943137f0235336872a333ecb87352c880
Initial production release of the linux-ssh-init-sh script with integrated i18n support for English and Chinese.
Linux Server Init & SSH Hardening Script (linux-ssh-init-sh)
📖 English
A production-ready, POSIX-compliant shell script designed to initialize Linux servers and harden SSH security in minutes.
✨ Key Features
- Universal Compatibility: Works flawlessly on Debian 10/11/12, Ubuntu, CentOS 7/8/9, Alma/Rocky, and Alpine Linux.
- POSIX Compliant: Written in pure
/bin/sh. Nobashdependency. - Safety Architecture:
- Managed Config Block: Inserts configuration at the top of
sshd_configto strictly override vendor defaults (bypasses the Debian 12Includetrap). - Anti-Lockout: Smart fallback mechanisms to prevent locking yourself out (see Strict Mode below).
- Firewall Awareness: Automatically configures
ufworfirewalldwhen changing ports.
- Managed Config Block: Inserts configuration at the top of
- Automation:
- SSH Keys: Imports from GitHub/URL/Paste.
- Random Port: Generates valid random high ports (20000-60000).
- Optimization: One-click System Update & TCP BBR.
🚀 Quick Start
Run as root:
curl -fsSL [https://raw.githubusercontent.com/247like/linux-ssh-init-sh/main/init.sh](https://raw.githubusercontent.com/247like/linux-ssh-init-sh/main/init.sh) -o init.sh && chmod +x init.sh && ./init.sh
Description
POSIX-compliant Linux server initialization & SSH hardening script. (Debian/Ubuntu/CentOS/Alpine) | Linux 服务器初始化与 SSH 安全加固脚本(一键配置密钥、端口、BBR)。
225 KiB
0 Stars
1 Watchers
0 Forks
Languages
Shell
100%