Ultimate Security Guide for XUI.one & IPTV Panels: Block Brute Force & Harden Your Server
🛡️ Best Linux Security Script to Protect IPTV Servers Like XUI.one from Brute Force & DDoS
If you're running a public project like a streaming panel (XUI.one, Flussonic, or similar) on a Linux server, proper security is non-negotiable. Most brute-force attacks start with insecure SSH logins and weak passwords. This tutorial will guide you through preparing your server for secure SSH key authentication and implementing advanced hardening with the improved_harden_linux.sh
script.
🔐 Why Password SSH is Dangerous
Many servers still allow login with simple passwords via SSH. These passwords often come from known dictionary lists and are targeted constantly by botnets and brute-force tools. This puts your project at serious risk.
Solution: Switch to RSA key-based authentication for SSH — a far more secure and modern approach.
🧰 Tools Required
- WinSCP: File transfer and SSH key tool – Download WinSCP
- PuTTYgen: Key generator (bundled with WinSCP or separate)
⚙️ Step-by-Step: Generate and Install RSA Key on Ubuntu Server
1. Generate Key Pair with PuTTYgen
- Open PuTTYgen
- Choose "RSA" and set 4096 bits
- Click Generate and move your mouse to create entropy

- Save the Private Key (e.g.,
mykey.ppk
) - Copy the entire Public Key from the top box
2. Add the Key to Your Ubuntu Server
- Log into your server using your current SSH credentials
Type this command:
mkdir -p ~/.ssh
nano ~/.ssh/authorized_keys
- Paste your public key from PuTTYgen
- Save and exit (Ctrl+X, then Y)
3. Disable Password Login
Edit the SSH config:
sudo nano /etc/ssh/sshd_config
Find and change the following lines:
PasswordAuthentication no
Or type this command:
sed -i -E 's/^#?(PermitRootLogin).*$/\1 yes/; s/^#?(PubkeyAuthentication).*$/\1 yes/; s/^#?(PasswordAuthentication).*$/\1 yes/' /etc/ssh/sshd_config
Restart SSH:
sudo systemctl restart sshd
Now your server only accepts RSA keys for SSH login.
3. Configure WinSCP to Use the Private Key
- Open WinSCP
- Create a new session:
- Hostname: your server IP or domain
- Username: your SSH user

- Click on Advanced → SSH → Authentication
- In the "Private key file" field, browse and select your
.ppk
file

- Save the session and connect
🔒 What is improved_harden_linux.sh?
improved_harden_linux.sh
is a full-featured hardening script created by @captainzero93, an open-source contributor focused on Linux server security. It’s available publicly on GitHub and widely used in the DevOps and cybersecurity communities for quick and powerful server lockdowns.
This script secures your Linux server with multiple security best practices:
- SSH hardening and port change
- Disabling unused services
- Firewall rules with
ufw
- Kernel hardening
- Protection against common network attacks (DoS, spoofing)
- Sysctl optimizations
- Rootkit and malware scanning tools
- Audit and log policies
Official Repository: https://github.com/captainzero93/security_harden_linux
It is open-source, readable, and extremely safe to run. You can inspect the code before applying, and a --dry-run
mode is available for previewing changes.
🛠️ How to Install improved_harden_linux.sh
- Connect via SSH with your RSA key
Run the following commands:
wget https://raw.githubusercontent.com/captainzero93/security_harden_linux/main/improved_harden_linux.sh
chmod +x improved_harden_linux.sh
Optional: Dry Run First
sudo ./improved_harden_linux.sh --dry-run
Final Installation:
sudo ./improved_harden_linux.sh
This script will secure your server in just a few minutes with minimal intervention.
🧠 Why It Matters for IPTV & Streaming Projects
Whether you're using XUI.one 1.5.13, Flussonic Media Server, or any OTT streaming solution:
- You store client data, stream URLs, DNS settings
- Your server is public-facing, exposed to constant attacks
- Uptime, integrity, and data protection are essential
Security is not optional — it's the foundation of your streaming business.
✅ Extra Resources
- 💾 Reinstall Your OS Easily: If you want to reformat and reinstall your server securely from command line, we highly recommend Netboot.xyz

- 📖 Install IPTV Control Panels: Want to turn your secure server into an IPTV powerhouse? Check out our dedicated documentation hub:
https://iptvtools.io/iptv-docs/
