No description
LICENSE | ||
README.md | ||
zerotier-setup.sh |
-
Initial Setup:
- The script first checks if it's running as root (administrator), which is required for system changes
- It defines important variables like ports and file paths that will be used
-
ZeroTier Installation:
- Installs ZeroTier One client using their official installer
- Joins your ZeroTier network (you'll need to put in ssh with your actual network ID)
-
Network Configuration:
- Waits for the ZeroTier network connection to establish
- Gets your ZeroTier IP address (the address assigned to your server on the ZeroTier network)
-
Backup Creation:
- Creates backup copies of your nginx configuration and database
- This is a safety measure in case you need to revert changes
-
Service Configuration:
- Modifies the nginx configuration to only listen on your ZeroTier IP address
- Updates the firewall rules in the SQLite database to:
- Remove existing rules for SSH and CloudPanel ports
- Add new rules that only allow access from your ZeroTier IP
-
Service Restart:
- Restarts nginx and SSH services to apply the changes
- Verifies ZeroTier connection status
To use this script:
- Save it to a file (e.g.,
setup-zerotier.sh
) - Replace
YOUR_NETWORK_ID_HERE
with your actual ZeroTier network ID - Make it executable:
chmod +x setup-zerotier.sh
- Run it as root:
sudo ./setup-zerotier.sh
Important Notes:
- Keep your backup files safe in case you need to restore
- After running this script, you'll only be able to access SSH and CloudPanel through ZeroTier
- Double-check your ZeroTier network ID before running
- Make sure you have access to your server through ZeroTier before running this script
- Test the connection through ZeroTier before logging out of your current session