Made updates based on comments

added changes related to chown and chmod of .ovpn12 file.  Also removed sudo.
This commit is contained in:
IcedComputer 2019-06-27 11:47:24 -07:00 committed by GitHub
parent bda0d58b81
commit dae6276d37
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -274,10 +274,12 @@ echo "tls-auth Private Key found: $TA"
## https://openvpn.net/faq/how-do-i-use-a-client-certificate-and-private-key-from-the-ios-keychain/
printf "========================================================\n"
printf "Generating an .ovpn12 file for use with iOS devices\n"
printf "You will be prompted to re-enter some information from the cert you just created\n"
printf "========================================================\n"
sudo openssl pkcs12 -export -in issued/${NAME}${CRT} -inkey private/${NAME}${KEY} -certfile ${CA} -name ${NAME} -out /home/$INSTALL_USER/ovpns/$NAME.ovpn12
openssl pkcs12 -export -in issued/${NAME}${CRT} -inkey private/${NAME}${KEY} -certfile ${CA} -name ${NAME} -out /home/$INSTALL_USER/ovpns/$NAME.ovpn12
chown "$INSTALL_USER" "/home/$INSTALL_USER/ovpns/$NAME.ovpn12"
chmod o-r "/home/$INSTALL_USER/ovpns/$NAME.ovpn12"
# Copy the .ovpn profile to the home directory for convenient remote access
cp "/etc/openvpn/easy-rsa/pki/$NAME$FILEEXT" "/home/$INSTALL_USER/ovpns/$NAME$FILEEXT"