Skip to content

Instantly share code, notes, and snippets.

@thomanhphuc
Created February 17, 2025 08:31
Show Gist options
  • Save thomanhphuc/fcedf4112e2bd9fa9f4aeb9499ed204a to your computer and use it in GitHub Desktop.
Save thomanhphuc/fcedf4112e2bd9fa9f4aeb9499ed204a to your computer and use it in GitHub Desktop.
OpenVPN Community for Amazon Linux 2 + 2FA with Google Authenticator
git clone https://github.com/danilvalov/openvpn_amazon_linux_2fa.git
cd openvpn_amazon_linux_2fa
chmod +x install-openvpn.sh manage-openvpn.sh
./install-openvpn.sh
Open /etc/openvpn/easy-rsa/easyrsa file, find the function called gen_req(), and change a parameter called opts= to opts="-passout stdin"
Edit /etc/openvpn/server.conf
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
./manage-openvpn.sh create fred
Edit /opt/openvpn/clients/fred/fred.ovpn
redirect-gateway def1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment