trojan_manager is a handy Bash utility for managing users of the Trojan VPN protocol. It helps admins quickly add/delete users, generate ready-to-use VPN config strings and QR codes, and perform basic access management on small and medium servers.
- Add new users for Trojan VPN
- Generate connection URI and QR code (for fast onboarding)
- Manage users: remove, lock by date, regenerate password
- Logs all actions
- Integrates with systemd trojan service
- MIT licensed
Note:
Place trojan_manager.sh into your Trojan installation directory, typically/usr/local/etc/trojan/.
- Bash (tested on Linux)
- jq (
sudo apt install jq) - qrencode (
sudo apt install qrencode) - systemd, trojan running as a servicegit
- Copy
trojan_manager.shto a folder and make it executable:chmod +x trojan_manager.sh
- Ensure dependencies are installed:
sudo apt install jq qrencode
- Run with root privileges, for example, to add a user:
The script will display a connection URI and a QR code for the new user.
sudo ./trojan_manager.sh --new username
--new <user>— create a new user with a unique password--list— list and manage users (regenerate password, lock, delete, show QR, etc)--qr <user>— show a QR code for specified user--config <user>— print user's connection URI--restart— restarttrojan.service--help— print help
- The script expects a
config.jsonfile with a password array, each entry in form"username_password" - User metadata is kept in
users.json