mergee ca.crt, ta.key into clien.ovpn (#128)
* fixed: easyrsa rm * added ufw and firewall-cmd commands * fixed easy-rsa name package name * Revert "added ufw and firewall-cmd commands" This reverts commit ddbb0b17d564abeb835d221431d8a9078ff0202e. * merge ca.crt, ta.key into clien.ovpn closed #72
This commit is contained in:
parent
c193f3e0e2
commit
4e33e2224e
11
install.sh
11
install.sh
@ -121,6 +121,7 @@ wget "https://github.com/OpenVPN/easy-rsa/releases/download/v3.0.6/EasyRSA-unix-
|
|||||||
tar -xaf "EasyRSA-unix-v3.0.6.tgz"
|
tar -xaf "EasyRSA-unix-v3.0.6.tgz"
|
||||||
mv "EasyRSA-v3.0.6" /etc/openvpn/easy-rsa
|
mv "EasyRSA-v3.0.6" /etc/openvpn/easy-rsa
|
||||||
rm "EasyRSA-unix-v3.0.6.tgz"
|
rm "EasyRSA-unix-v3.0.6.tgz"
|
||||||
|
|
||||||
cd /etc/openvpn/easy-rsa
|
cd /etc/openvpn/easy-rsa
|
||||||
|
|
||||||
if [[ ! -z $key_size ]]; then
|
if [[ ! -z $key_size ]]; then
|
||||||
@ -231,8 +232,14 @@ sed -i "s/\$user = '';/\$user = '$mysql_user';/" "./include/config.php"
|
|||||||
sed -i "s/\$pass = '';/\$pass = '$mysql_pass';/" "./include/config.php"
|
sed -i "s/\$pass = '';/\$pass = '$mysql_pass';/" "./include/config.php"
|
||||||
|
|
||||||
# Replace in the client configurations with the ip of the server and openvpn protocol
|
# Replace in the client configurations with the ip of the server and openvpn protocol
|
||||||
for file in "./client-conf/gnu-linux/client.conf" "./client-conf/osx-viscosity/client.conf" "./client-conf/windows/client.ovpn"; do
|
for file in $(find -name client.ovpn); do
|
||||||
sed -i "s/remote xxx\.xxx\.xxx\.xxx 443/remote $ip_server $server_port/" $file
|
sed -i "s/remote xxx\.xxx\.xxx\.xxx 443/remote $ip_server $server_port/" $file
|
||||||
|
echo "<ca>" >> $file
|
||||||
|
cat "/etc/openvpn/ca.crt" >> $file
|
||||||
|
echo "</ca>" >> $file
|
||||||
|
echo "<tls-auth>" >> $file
|
||||||
|
cat "/etc/openvpn/ta.key" >> $file
|
||||||
|
echo "</tls-auth>"
|
||||||
|
|
||||||
if [ $openvpn_proto = "udp" ]; then
|
if [ $openvpn_proto = "udp" ]; then
|
||||||
sed -i "s/proto tcp-client/proto udp/" $file
|
sed -i "s/proto tcp-client/proto udp/" $file
|
||||||
|
@ -8,8 +8,6 @@ redirect-gateway
|
|||||||
|
|
||||||
# Keys
|
# Keys
|
||||||
# Identity
|
# Identity
|
||||||
ca ca.crt
|
|
||||||
tls-auth ta.key 1
|
|
||||||
key-direction 1
|
key-direction 1
|
||||||
remote-cert-tls server
|
remote-cert-tls server
|
||||||
auth-user-pass
|
auth-user-pass
|
@ -8,8 +8,6 @@ redirect-gateway
|
|||||||
|
|
||||||
# Keys
|
# Keys
|
||||||
# Identity
|
# Identity
|
||||||
ca ca.crt
|
|
||||||
tls-auth ta.key 1
|
|
||||||
key-direction 1
|
key-direction 1
|
||||||
remote-cert-tls server
|
remote-cert-tls server
|
||||||
auth-user-pass
|
auth-user-pass
|
@ -8,8 +8,6 @@ redirect-gateway
|
|||||||
|
|
||||||
# Keys
|
# Keys
|
||||||
# Identity
|
# Identity
|
||||||
ca ca.crt
|
|
||||||
tls-auth ta.key 1
|
|
||||||
key-direction 1
|
key-direction 1
|
||||||
remote-cert-tls server
|
remote-cert-tls server
|
||||||
auth-user-pass
|
auth-user-pass
|
||||||
|
Loading…
Reference in New Issue
Block a user