mirror of
https://github.com/angristan/openvpn-install.git
synced 2025-05-09 18:28:23 +02:00
Merge 5572740184d2af858edf5c1401458c235a1d9a18 into e1f19e0f246c4e429dbf32bdf0a0a507d8ac194b
This commit is contained in:
commit
996b4d270c
19
README.md
19
README.md
@ -10,6 +10,13 @@ This script will let you setup your own secure VPN server in just a few seconds.
|
|||||||
|
|
||||||
You can also check out [wireguard-install](https://github.com/angristan/wireguard-install), a simple installer for a simpler, safer, faster and more modern VPN protocol.
|
You can also check out [wireguard-install](https://github.com/angristan/wireguard-install), a simple installer for a simpler, safer, faster and more modern VPN protocol.
|
||||||
|
|
||||||
|
|
||||||
|
## One-Stop Solutions for the Public Cloud
|
||||||
|
|
||||||
|
Solutions that provision a ready to use OpenVPN server based on `openvpn-install` in one go are available for
|
||||||
|
- AWS using Terraform at [`openvpn-terraform-install`](https://github.com/dumrauf/openvpn-terraform-install) and described in [Ready to Use OpenVPN Servers in AWS For Everyone](https://www.how-hard-can-it.be/openvpn-server-install-terraform-aws/)
|
||||||
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
First, get the script and make it executable:
|
First, get the script and make it executable:
|
||||||
@ -93,6 +100,18 @@ export PASS="1"
|
|||||||
./openvpn-install.sh
|
./openvpn-install.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Headless User Removal
|
||||||
|
|
||||||
|
The removal of an existing user can also be fully automated. Again, the key is to provide the (string) value of the `MENU_OPTION` variable along with the remaining mandatory variables before invoking the script.
|
||||||
|
|
||||||
|
The following Bash script removes the existing user `bar` from an OpenVPN configuration
|
||||||
|
```bash
|
||||||
|
#!/bin/bash
|
||||||
|
export MENU_OPTION="2"
|
||||||
|
export CLIENT="bar"
|
||||||
|
./openvpn-install.sh
|
||||||
|
```
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- Installs and configures a ready-to-use OpenVPN server
|
- Installs and configures a ready-to-use OpenVPN server
|
||||||
|
@ -1201,6 +1201,7 @@ function revokeClient() {
|
|||||||
echo ""
|
echo ""
|
||||||
echo "Select the existing client certificate you want to revoke"
|
echo "Select the existing client certificate you want to revoke"
|
||||||
tail -n +2 /etc/openvpn/easy-rsa/pki/index.txt | grep "^V" | cut -d '=' -f 2 | nl -s ') '
|
tail -n +2 /etc/openvpn/easy-rsa/pki/index.txt | grep "^V" | cut -d '=' -f 2 | nl -s ') '
|
||||||
|
until [[ $CLIENT =~ ^[a-zA-Z0-9_]+$ ]]; do
|
||||||
until [[ $CLIENTNUMBER -ge 1 && $CLIENTNUMBER -le $NUMBEROFCLIENTS ]]; do
|
until [[ $CLIENTNUMBER -ge 1 && $CLIENTNUMBER -le $NUMBEROFCLIENTS ]]; do
|
||||||
if [[ $CLIENTNUMBER == '1' ]]; then
|
if [[ $CLIENTNUMBER == '1' ]]; then
|
||||||
read -rp "Select one client [1]: " CLIENTNUMBER
|
read -rp "Select one client [1]: " CLIENTNUMBER
|
||||||
@ -1209,6 +1210,7 @@ function revokeClient() {
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
CLIENT=$(tail -n +2 /etc/openvpn/easy-rsa/pki/index.txt | grep "^V" | cut -d '=' -f 2 | sed -n "$CLIENTNUMBER"p)
|
CLIENT=$(tail -n +2 /etc/openvpn/easy-rsa/pki/index.txt | grep "^V" | cut -d '=' -f 2 | sed -n "$CLIENTNUMBER"p)
|
||||||
|
done
|
||||||
cd /etc/openvpn/easy-rsa/ || return
|
cd /etc/openvpn/easy-rsa/ || return
|
||||||
./easyrsa --batch revoke "$CLIENT"
|
./easyrsa --batch revoke "$CLIENT"
|
||||||
EASYRSA_CRL_DAYS=3650 ./easyrsa gen-crl
|
EASYRSA_CRL_DAYS=3650 ./easyrsa gen-crl
|
||||||
|
Loading…
x
Reference in New Issue
Block a user