awg-manager/README.md

65 lines
1.7 KiB
Markdown
Raw Normal View History

2024-02-12 06:01:15 +00:00
# awg-manager
2022-11-03 15:37:53 +00:00
2024-02-12 06:01:15 +00:00
AmneziaWG manager allow initialize AmneziaWG server and manage users.
2022-11-03 15:37:53 +00:00
2024-02-12 06:01:15 +00:00
You can start the AmneziaWG server with one command, and then create (and delete) users.
2022-11-03 15:53:56 +00:00
2022-11-03 15:37:53 +00:00
```bash
2024-02-12 06:01:15 +00:00
Usage: ./awg-manager.sh [<options>] [command [arg]]
2022-11-03 15:37:53 +00:00
Options:
-i : Init (Create server keys and configs)
-c : Create new user
-d : Delete user
2022-12-13 19:07:37 +00:00
-L : Lock user
-U : Unlock user
2022-11-03 15:37:53 +00:00
-p : Print user config
-u <user> : User identifier (uniq field for vpn account)
-s <server> : Server host for user connection
2022-12-13 19:07:37 +00:00
-I : Interface (default auto)
2022-11-03 15:37:53 +00:00
-h : Usage
```
## Quick start
2024-02-12 06:01:15 +00:00
Run server (bare-metal or VPS) with Ubuntu 20.02, 22.02
2022-11-03 15:37:53 +00:00
2024-02-12 06:01:15 +00:00
### Install AmneziaWG
2022-11-03 15:37:53 +00:00
```bash
2024-02-12 06:01:15 +00:00
apt update && apt upgrade -y
apt install build-essential curl git wget -y
#install Golang
mkdir -p /opt/go
cd /opt/go
wget https://go.dev/dl/go1.22.0.linux-amd64.tar.gz
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.22.0.linux-amd64.tar.gz
echo "export PATH=$PATH:/usr/local/go/bin" >> /etc/profile
source $HOME/.profile
# if the go version does not show, then update the session
#Install amnezia-go
git clone https://github.com/amnezia-vpn/amneziawg-go.git /opt/amnezia-go
cd /opt/amnezia-go
make
#copy to amneziawg-go
cp /opt/amnezia-go/amneziawg-go /usr/bin
#Install amnezia-tools
git clone https://github.com/amnezia-vpn/amneziawg-tools.git /opt/amnezia-tools
cd /opt/amnezia-tools/src
make
make install
2022-11-03 15:37:53 +00:00
```
### Setup
2022-11-03 15:42:20 +00:00
- Download this script [wg-manager.sh](https://danuk.github.io/wg-manager/wg-manager.sh) from GitHub
2022-11-03 15:37:53 +00:00
- Initialize WireGuard server: `./wg-manager.sh -i -s YOUR_SERVER_IP`
- Add your user: `./wg-manager.sh -c -u my_user -p > wg-client.conf`
- Install WireGuard on the client
- Start client with config `wg-client.conf`
2022-11-03 16:12:23 +00:00