Server Initialization Guide
209 words
1 minute
Server Initialization Guide
Server Initialization Guide
1. System Update
apt updateapt upgrade -y2. Security Hardening
Change the SSH Port
Edit the SSH config file /etc/ssh/sshd_config and change the default port 22:
vim /etc/ssh/sshd_config# Find #Port 22, change to Port your-port# Save and restart the servicesystemctl restart sshCreate a Non-root User
# Create a new useradduser your-username
# Install sudoapt install sudo
# Add the user to the sudo groupusermod -aG sudo your-username
# Or edit /etc/sudoers to add:# your-username ALL=(ALL) NOPASSWD: ALLDisable Root Remote Login
# In /etc/ssh/sshd_config, set:PermitRootLogin noSSH Key Authentication + Disable Passwords
# Generate a key pair locally, then copy the public key to the serverssh-copy-id your-username@your-server-ip
# In /etc/ssh/sshd_config:PasswordAuthentication noPubkeyAuthentication yes
# Restart the servicesudo systemctl restart ssh3. Install Common Software
Docker
Refer to the official Docker documentation for installation.
Nginx Proxy Manager
Install NPM via Docker for a web UI to manage reverse proxies and SSL certificates.
SSL Certificates
Use acme.sh + Cloudflare DNS API to issue wildcard certificates with auto-renewal.
Internal Network Tunneling (frp)
Use frp for internal network tunneling. Newer versions use TOML configuration.
Alist
Multi-storage mounting tool with one-click Docker deployment. See Alist documentation for details.
Firewall
- Remember to allow the new SSH port in the firewall
- Use iptables to mitigate SYN and CC attacks
- Only expose necessary ports (80, 443, SSH, etc.)
Support & Share
If this article helped you, please share or support!
Server Initialization Guide
https://blog.zinzin.cc/posts/server-init-guide-en/Related PostsSmart
1
Docker Image and Container Export/Import Commands Explained
DevOpsClarifying the differences between docker commit/export/import/save/load and when to use each one.
2
Deploy a Nacos Cluster with Docker
DevOpsA complete guide to deploying a 3-node Nacos 2.2 cluster with Docker, using MySQL for persistence and Nginx for load balancing.
3
Request Wildcard SSL Certificates with acme.sh
DevOpsGet free Let's Encrypt wildcard certificates via acme.sh + Cloudflare DNS API with automatic renewal.
4
2025 Year in Review
Annual ReviewReflections on 2025 — covering work, learning, health, books, games, anime, and travel.
5
Switch Java (JDK) Versions Freely with Scoop
Dev ToolsInstall multiple JDK versions on Windows using Scoop package manager and switch between them with a single command — no more manual environment variable tweaking.
Random PostsRandom













