mirror of
https://github.com/Nyr/openvpn-install.git
synced 2024-11-23 21:46:08 +03:00
2048 bit keys by default and Debian Jessie compatibility
This commit is contained in:
parent
730691c8a1
commit
31040f475a
@ -128,10 +128,18 @@ else
|
||||
read -n1 -r -p "Press any key to continue..."
|
||||
apt-get update
|
||||
apt-get install openvpn iptables openssl -y
|
||||
cp -R /usr/share/doc/openvpn/examples/easy-rsa/ /etc/openvpn
|
||||
# easy-rsa isn't available by default for Debian Jessie and newer
|
||||
if [ ! -d /etc/openvpn/easy-rsa/2.0/ ]; then
|
||||
wget --no-check-certificate -O ~/easy-rsa.tar.gz https://github.com/OpenVPN/easy-rsa/archive/master.tar.gz
|
||||
tar xzf ~/easy-rsa.tar.gz -C ~/
|
||||
mkdir -p /etc/openvpn/easy-rsa/2.0/
|
||||
cp ~/easy-rsa-master/easy-rsa/2.0/* /etc/openvpn/easy-rsa/2.0/
|
||||
fi
|
||||
cd /etc/openvpn/easy-rsa/2.0/
|
||||
# Let's fix one thing first...
|
||||
cp -u -p openssl-1.0.0.cnf openssl.cnf
|
||||
# Fuck you NSA - 1024 bits was the default for Debian Wheezy and older
|
||||
sed -i 's|export KEY_SIZE=1024|export KEY_SIZE=2048|' /etc/openvpn/easy-rsa/2.0/vars
|
||||
# Create the PKI
|
||||
. /etc/openvpn/easy-rsa/2.0/vars
|
||||
. /etc/openvpn/easy-rsa/2.0/clean-all
|
||||
@ -154,10 +162,10 @@ else
|
||||
gunzip -d server.conf.gz
|
||||
cp server.conf /etc/openvpn/
|
||||
cd /etc/openvpn/easy-rsa/2.0/keys
|
||||
cp ca.crt ca.key dh1024.pem server.crt server.key /etc/openvpn
|
||||
cp ca.crt ca.key dh2048.pem server.crt server.key /etc/openvpn
|
||||
cd /etc/openvpn/
|
||||
# Set the server configuration
|
||||
sed -i 's|;push "redirect-gateway def1 bypass-dhcp"|push "redirect-gateway def1 bypass-dhcp"|' server.conf
|
||||
sed -i 's|dh dh1024.pem|dh dh2048.pem|' server.conf
|
||||
sed -i 's|;push "dhcp-option DNS 208.67.222.222"|push "dhcp-option DNS 129.250.35.250"|' server.conf
|
||||
sed -i 's|;push "dhcp-option DNS 208.67.220.220"|push "dhcp-option DNS 74.82.42.42"|' server.conf
|
||||
sed -i "s|port 1194|port $PORT|" server.conf
|
||||
|
Loading…
Reference in New Issue
Block a user