A collection of a few scripts for easily managing wireguard from the command line. Just run these scripts to add/remove users to your existing wireguard set up.
- Sign in as a user with sudo priveleges on the server running wireguard
- Clone the repo and install qrencode: (you can copy and paste this)
git clone https://github.com/hgibs/simple-wireguard-admin.git
cd simple-wireguard-admin
cp config.cfg.defaults config.cfg
sudo apt install -y qrencode
- Edit the
config.cfg
file to match your set up. - Review all the scripts and ensure they don't do anything bad! You should never run scripts you find on the internet willy-nilly,
especially ones you run as root. i.e.
cat *
- Please have
SaveConfig = true
enabled in your wg0.conf - This assumes your instance is running *nix (including MacOS).
- This does not re-use IP addresses after they are removed, if you plan on adding more than 9999 clients before resetting and creating a new configuration, I'd recommend using a different, more fully featured set up.
./create-key.sh [identifier]
i.e. ./create-key.sh my-phone
./getqrcode.sh [identifier]
i.e. ./getqrcode.sh my-phone
./remove-user.sh [identifier]
i.e. ./remove-user.sh my-phone
Thats it! Lightweight and easy to use. Give me a star if you used this, if you want to!