2021-02-05 01:37:12 -05:00
|
|
|
|
# openvpn-user
|
|
|
|
|
|
2021-02-05 13:19:54 -05:00
|
|
|
|
## Disclaimer
|
|
|
|
|
```diff
|
|
|
|
|
- Not tested in production environments!
|
|
|
|
|
```
|
|
|
|
|
|
2021-02-05 01:37:12 -05:00
|
|
|
|
|
|
|
|
|
Use it on your own risk =)
|
|
|
|
|
|
|
|
|
|
### Description
|
|
|
|
|
A simple tool to use with openvpn when you need to use `–auth-user-pass-verify` or wherever you want
|
|
|
|
|
|
|
|
|
|
### Example
|
2021-02-05 13:19:54 -05:00
|
|
|
|
make sure `openvpn-user` binary available through `PATH` variable and you have `auth.sh` script with `+x` rights available to openvpn server
|
|
|
|
|
|
|
|
|
|
i.e. put binary to `/usr/local/sbin/` and auth script to `/etc/openvpn/scripts/` dir
|
2021-02-05 01:37:12 -05:00
|
|
|
|
|
|
|
|
|
part of openvpn server config
|
|
|
|
|
```bash
|
2021-02-05 13:19:54 -05:00
|
|
|
|
script-security 2
|
2021-02-05 01:37:12 -05:00
|
|
|
|
auth-user-pass-verify /etc/openvpn/scripts/auth.sh via-file
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Usage
|
|
|
|
|
```
|
|
|
|
|
usage: openvpn-user [<flags>] <command> [<args> ...]
|
|
|
|
|
|
|
|
|
|
Flags:
|
|
|
|
|
--help Show context-sensitive help (also try --help-long and --help-man).
|
|
|
|
|
--db.path="./openvpn-user.db" path do openvpn-user db
|
|
|
|
|
|
|
|
|
|
Commands:
|
|
|
|
|
help [<command>...]
|
|
|
|
|
Show help.
|
|
|
|
|
|
|
|
|
|
db-init
|
|
|
|
|
Init db.
|
|
|
|
|
|
|
|
|
|
db-migrate
|
|
|
|
|
STUB: Migrate db.
|
|
|
|
|
|
|
|
|
|
create --user=USER --password=PASSWORD
|
|
|
|
|
Create user.
|
|
|
|
|
|
2022-05-23 09:21:54 -04:00
|
|
|
|
delete --user=USER [<flags>]
|
2021-02-05 01:37:12 -05:00
|
|
|
|
Delete user.
|
2022-05-23 09:21:54 -04:00
|
|
|
|
|
|
|
|
|
flags:
|
|
|
|
|
--force Delete from db
|
2021-02-05 01:37:12 -05:00
|
|
|
|
|
|
|
|
|
revoke --user=USER
|
|
|
|
|
Revoke user.
|
|
|
|
|
|
|
|
|
|
restore --user=USER
|
|
|
|
|
Restore user.
|
|
|
|
|
|
|
|
|
|
list [<flags>]
|
|
|
|
|
List active users.
|
|
|
|
|
|
|
|
|
|
flags:
|
|
|
|
|
--all Show all users include revoked and delete
|
|
|
|
|
|
|
|
|
|
auth --user=USER --password=PASSWORD
|
|
|
|
|
Auth user.
|
|
|
|
|
|
|
|
|
|
change-password --user=USER --password=PASSWORD
|
2022-05-23 09:21:54 -04:00
|
|
|
|
Change password.
|
2021-02-05 01:37:12 -05:00
|
|
|
|
```
|