openvpn-user/README.md

115 lines
2.3 KiB
Markdown
Raw Normal View History

2021-02-05 01:37:12 -05:00
# openvpn-user
2021-02-05 13:19:54 -05:00
## Disclaimer
```
2021-02-05 13:19:54 -05:00
- 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
make sure `openvpn-user` binary available through `PATH` variable and you have [auth.sh](https://github.com/pashcovich/openvpn-user/blob/master/auth.sh) or [auth_totp.sh](https://github.com/pashcovich/openvpn-user/blob/master/auth_totp.sh) script with `+x` rights available to openvpn server
2021-02-05 13:19:54 -05:00
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
```
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.
2021-02-05 01:37:12 -05:00
db-init
Init db.
2021-02-05 01:37:12 -05:00
db-migrate
STUB: Migrate db.
2021-02-05 01:37:12 -05:00
create --user=USER --password=PASSWORD
Create user.
--user=USER Username.
--password=PASSWORD Password.
2022-05-23 09:21:54 -04:00
delete --user=USER [<flags>]
2021-02-05 01:37:12 -05:00
Delete user.
-f, --force delete from db.
-u, --user=USER Username.
2021-02-05 01:37:12 -05:00
revoke --user=USER
Revoke user.
-u, --user=USER Username.
2021-02-05 01:37:12 -05:00
restore --user=USER
Restore user.
-u, --user=USER Username.
2021-02-05 01:37:12 -05:00
list [<flags>]
List active users.
-a, --all Show all users include revoked and deleted.
2022-11-14 11:26:34 -05:00
check --user=USER
check user existent.
-u, --user=USER Username.
2022-11-14 11:26:34 -05:00
auth --user=USER [<flags>]
2021-02-05 01:37:12 -05:00
Auth user.
-u, --user=USER Username.
-p, --password=PASSWORD Password.
-t, --totp=TOTP TOTP code.
2021-02-05 01:37:12 -05:00
change-password --user=USER --password=PASSWORD
2022-11-14 11:26:34 -05:00
Change password
-u, --user=USER Username.
-p, --password=PASSWORD Password.
2022-11-14 11:26:34 -05:00
update-secret --user=USER [<flags>]
update OTP secret
-u, --user=USER Username.
-s, --secret="generate" Secret.
register-app --user=USER --totp=TOTP
2022-11-14 11:26:34 -05:00
register 2FA application
-u, --user=USER Username.
-t, --totp=TOTP TOTP.
check-app --user=USER
check 2FA application
-u, --user=USER Username.
2022-11-14 11:26:34 -05:00
get-secret --user=USER
get OTP secret
-u, --user=USER Username.
2021-02-05 01:37:12 -05:00
```