Rooted by VladiMIR + AI | Public scripts for server hardening, Samba file sharing, and IPGuard security.
All scripts are idempotent — safe to run multiple times on the same server.
bash <(curl -sL https://raw.githubusercontent.com/GinCz/Linux_Server_Public/main/scripts/samba_setup.sh)Installs Samba, creates users and shares, hardens smb.conf, configures UFW,
then automatically calls IPGuard at the end — no separate security step needed.
bash <(curl -fsSL https://raw.githubusercontent.com/GinCz/Linux_Server_Public/main/blacklist/install-ipguard.sh)Full triple-layer protection for any server (web, VPN, mail, etc.), not just Samba.
Linux_Server_Public/
├── scripts/ — Samba management scripts
│ ├── samba_setup.sh — Full Samba installer (main script)
│ ├── samba_audit_all.sh — Audit + auto-fix Samba on ALL servers via SSH
│ └── remove_samba.sh — Remove Samba completely and close ports
├── blacklist/ — IPGuard security system
│ ├── install-ipguard.sh — IPGuard installer (authoritative, full protection)
│ ├── deploy-blacklist.sh — Apply/update the ipset blacklist (called by cron)
│ └── blacklist.txt — Aggregated IP blacklist from all 10 nodes
├── configs/ — Reference server configs (MariaDB, etc.)
└── windows/ — Windows client scripts
└── SMB_Connect.bat — Connect all 10 SMB servers at once (see windows/README.md)
Актуально с v2026.06.15b
На всех 9 серверах (7 VPN + IONOS + AWS) идентичная структура:
/storage/
├── soft/ ← [soft] — vlad RW, usr RO
└── user/ ← [user] — vlad RW, usr RW
Windows видит три шары на каждом сервере:
| Шара | Linux путь | vlad | usr | Описание |
|---|---|---|---|---|
\storage |
/storage |
browse only | browse only | Корень — показывает soft и user |
\storage\soft → \soft |
/storage/soft |
Read+Write | Read only | Основное хранилище |
\storage\user → \user |
/storage/user |
Read+Write | Read+Write | Пользовательский каталог |
Windows путь для подключения: \\SERVER_IP\storage
Внутри автоматически видны папки soft и user.
| Windows имя | IP | Диск | Провайдер / Роль |
|---|---|---|---|
| AWS_42 | 3.79.14.42 | K: | AWS Frankfurt |
| IONOS_38 | 82.223.116.38 | L: | IONOS (ICMP заблокирован) |
| ILYA_176 | 146.103.110.176 | I: | VPN нода |
| PILIK_178 | 91.84.118.178 | N: | Резервный сервер |
| 4TON_237 | 144.124.228.237 | O: | VPN нода |
| SO_38 | 144.124.233.38 | Q: | VPN нода |
| TATRA_9 | 144.124.232.9 | T: | VPN нода |
| SHAHIN_227 | 144.124.228.227 | V: | VPN нода |
| STOLB_24 | 144.124.239.24 | W: | VPN нода |
| ALEX_47 | 109.234.38.47 | Y: | VPN нода |
Управляющий сервер: EU-222 (152.53.182.222) — NetCup Germany, FastPanel + Cloudflare
RU-109 (212.109.223.109) — FastVDS Russia, FastPanel
См. windows/README.md — полное описание SMB_Connect.bat.
Краткое: запустить от Администратора, ввести пароль → все 10 дисков подключатся параллельно за ~8 секунд с цветным отчётом.
[ OK ] K: AWS_42 3.79.14.42
[ OK ] L: IONOS_38 82.223.116.38
[ SKIP ] N: PILIK_178 91.84.118.178 (сервер недоступен)
...
Full Samba installer — run this on a new server.
bash <(curl -sL https://raw.githubusercontent.com/GinCz/Linux_Server_Public/main/scripts/samba_setup.sh)What it does, step by step:
- Installs
sambaandsamba-common-binvia apt - Creates
/storage/softand/storage/userdirectories - Creates Linux users
vladandusr(no shell, no home directory) - Sets ownership
vlad:vladand permissions2770(setgid) on all directories - Prompts for Samba passwords for
vladandusr(skippable if already set) - Writes
smb.confwith shares[storage],[soft],[user] - Hardens
[global]: SMB2+ protocol, NTLMv2-only, no guest access, auth logging level 2 - Validates config with
testparm— restores backup if validation fails - Opens ports 445 and 139 in UFW with rate-limiting (6 connections / 30 seconds)
- Downloads and runs
blacklist/install-ipguard.sh— full IPGuard security
Audit and auto-fix Samba on every server via SSH.
bash /root/Linux_Server_Public/scripts/samba_audit_all.shRuns 19 checks on each server:
- Samba installed and running
- Linux users
vladandusrexist,usris in groupvlad - Both users registered in Samba (
pdbedit) - Directories exist with correct ownership (
vlad:vlad) and permissions (2770) - Write tests for both users on both directories
smb.confshares correct- Fail2Ban
sambajail active - UFW ports 445 and 139 open
Most issues are fixed automatically.
Remove Samba completely and close SMB ports.
bash <(curl -sL https://raw.githubusercontent.com/GinCz/Linux_Server_Public/main/scripts/remove_samba.sh)Does NOT delete /storage or any user data.
IPGuard — triple-layer security. Run on any server.
bash <(curl -fsSL https://raw.githubusercontent.com/GinCz/Linux_Server_Public/main/blacklist/install-ipguard.sh)| Layer | Tool | What it does |
|---|---|---|
| 1 | IPGuard ipset | Blocks all IPs in shared vladblacklist |
| 2 | CrowdSec | Pattern-based detection + community blocklist |
| 3 | Fail2Ban | SSH brute-force ban after 5 attempts / 5 min |
Incoming connection
│
▼
[IPGuard ipset] — DROP if IP is in vladblacklist (shared from 10 nodes)
│
▼
[CrowdSec bouncer] — DROP if IP is in CrowdSec decision list
│
▼
[Fail2Ban iptables] — DROP if IP triggered too many SSH failures
│
▼
[UFW rate-limit] — DROP if >6 connections in 30s (SMB only)
│
▼
[smb.conf / sshd] — Application-level auth (SMB2+, NTLMv2, no guest)
= Rooted by VladiMIR + AI | v2026.06.15b | github.com/GinCz =