mirror of
https://github.com/angristan/openvpn-install.git
synced 2025-05-09 10:18:22 +02:00
Merge 4e61e4bad8de3a43d1e7192e097c58286f80ae97 into e1f19e0f246c4e429dbf32bdf0a0a507d8ac194b
This commit is contained in:
commit
7f83b6773a
12
README.md
12
README.md
@ -37,6 +37,18 @@ When OpenVPN is installed, you can run the script again, and you will get the ch
|
||||
|
||||
In your home directory, you will have `.ovpn` files. These are the client configuration files. Download them from your server and connect using your favorite OpenVPN client.
|
||||
|
||||
## Cleaning of revoked users:
|
||||
## NOTE:
|
||||
For your safety, please run every time when you want to clean an already revoked user!
|
||||
This program is only for `REVOKED` users!
|
||||
|
||||
- Usage:
|
||||
```perl
|
||||
perl revoke-cleaner.pl
|
||||
# follow the steps...
|
||||
```
|
||||
|
||||
|
||||
If you have any question, head to the [FAQ](#faq) first. Please read everything before opening an issue.
|
||||
|
||||
**PLEASE do not send me emails or private messages asking for help.** The only place to get help is the issues. Other people may be able to help and in the future, other users may also run into the same issue as you. My time is not available for free just for you, you're not special.
|
||||
|
@ -1137,13 +1137,13 @@ function newClient() {
|
||||
# if not, use SUDO_USER
|
||||
if [ "${SUDO_USER}" == "root" ]; then
|
||||
# If running sudo as root
|
||||
homeDir="/root"
|
||||
homeDir="/etc/openvpn/client/"
|
||||
else
|
||||
homeDir="/home/${SUDO_USER}"
|
||||
fi
|
||||
else
|
||||
# if not SUDO_USER, use /root
|
||||
homeDir="/root"
|
||||
homeDir="/etc/openvpn/client"
|
||||
fi
|
||||
|
||||
# Determine if we use tls-auth or tls-crypt
|
||||
@ -1181,9 +1181,11 @@ function newClient() {
|
||||
echo "</tls-auth>"
|
||||
;;
|
||||
esac
|
||||
# $homeDir
|
||||
} >>"$homeDir/$CLIENT.ovpn"
|
||||
|
||||
echo ""
|
||||
# $homeDir
|
||||
echo "The configuration file has been written to $homeDir/$CLIENT.ovpn."
|
||||
echo "Download the .ovpn file and import it in your OpenVPN client."
|
||||
|
||||
|
54
revoke-cleaner.pl
Normal file
54
revoke-cleaner.pl
Normal file
@ -0,0 +1,54 @@
|
||||
#!/usr/bin/perl
|
||||
# Author @nu11secur1ty
|
||||
use strict;
|
||||
use warnings;
|
||||
use diagnostics;
|
||||
use Term::ANSIColor;
|
||||
|
||||
print color('GREEN');
|
||||
print "You should remove all lines which you see on this print with the path";
|
||||
print color('RESET');
|
||||
|
||||
print color('BLUE');
|
||||
print " (/etc/openvpn/easy-rsa/pki/index.txt)\n";
|
||||
print color('RESET');
|
||||
|
||||
print color('GREEN');
|
||||
print "because these users are already";
|
||||
print color('RESET');
|
||||
|
||||
print color('RED');
|
||||
print " revoked!\n";
|
||||
print color('RESET');
|
||||
|
||||
print color('GREEN');
|
||||
print "If you do not see lines with (R) in the beginning, you will have nothing to clean!\n\n\n";
|
||||
print color('RESET');
|
||||
|
||||
my $ENV = `cat /etc/openvpn/easy-rsa/pki/index.txt | grep R`;
|
||||
print "$ENV";
|
||||
|
||||
print color('Yellow');
|
||||
print "This is your issued crt's\n";
|
||||
print color('RESET');
|
||||
|
||||
my $issued = `ls -all /etc/openvpn/easy-rsa/pki/issued/`;
|
||||
print "$issued";
|
||||
|
||||
## Cleaning
|
||||
my $ENVPKI = "/etc/openvpn/easy-rsa/pki/index.txt";
|
||||
print "Preparing for cleaning...\n";
|
||||
|
||||
print color('RED');
|
||||
print "Please, choose the username, or if you are not really sure, just press Enter to exit the cleaner...\n";
|
||||
print color('RESET');
|
||||
|
||||
chomp (my $username = <STDIN>);
|
||||
my $cleaner = `sed -i '/$username/d' $ENVPKI`;
|
||||
|
||||
print color('YELLOW');
|
||||
print"Your client configurations in /etc/openvpn/client/ are...\n";
|
||||
print color('RESET');
|
||||
my $configs = `ls -all /etc/openvpn/client/`;
|
||||
print"$configs";
|
||||
exit 0;
|
7
share-client-config.pl
Normal file
7
share-client-config.pl
Normal file
@ -0,0 +1,7 @@
|
||||
#!/usr/bin/perl
|
||||
use strict;
|
||||
use warnings;
|
||||
use diagnostics;
|
||||
|
||||
my $clents = `cp -avr /etc/openvpn/client/* /var/www/html/`;
|
||||
print "$client"
|
Loading…
x
Reference in New Issue
Block a user