Urgent.News

What's breaking now, across thousands of outlets.

Tech

Installing OpenVPN on Ubuntu 24.04

OpenVPN is an open-source, full-featured VPN solution that enables secure site-to-site and point-to-point connections. OpenVPN creates encrypted tunnels using TLS (Transport Layer Security) to secure data transmission over untrusted networks such as the Internet between clients and servers. It supports multiple encryption algorithms, including AES-256, to encrypt traffic and protect network…

OpenVPN is a highly versatile and secure VPN solution, enabling site-to-site and point-to-point connections. It encrypts data using TLS, supporting strong encryption algorithms like AES-256. This guide focuses on installing OpenVPN on Ubuntu 24.04 and setting up a secure connection between a VPN server and client devices.

To begin, ensure you have an Ubuntu 24.04 server with sudo privileges. Start by updating the APT package index: `sudo apt update`, then install OpenVPN via `sudo apt install openvpn -y`. Confirm the installation using `openvpn --version`.

Next, create the essential OpenVPN files using Easy-RSA, a certificate authority management tool. Install Easy-RSA: `sudo apt install easy-rsa -y`, then navigate to your home directory: `cd`. Create a new easy-rsa directory: `mkdir easy-rsa`, and link it to the Easy-RSA script files: `ln -s /usr/share/easy-rsa/* easy-rsa/`. List the directory contents to ensure the linked files are present.

Now, modify the `vars` configuration file in the `easy-rsa` directory. Add your organization's details, including country, province, city, organization, email, and unit. Set the encryption algorithm to EC (Elliptic Curve) and the digest to SHA512. Initialize the PKI (Public Key Infrastructure) using the command: `./easyrsa init-pki`. Build the CA by executing `./easyrsa build-ca`, and remember to set a strong passphrase for signing certificate requests.

Next, generate a server certificate request: `./easyrsa gen-req vpnserver nopass`. Sign the request using the CA: `./easyrsa sign-req server vpnserver`. Verify the successful generation of the server certificate at `/home/linuxuser/easy-rsa/pki/issued/vpnserver.crt`. Generate a ta.key HMAC signature file for TLS verification: `sudo openvpn --genkey secret ta.key`. Secure key exchange with Diffie-Hellman parameters: `./easyrsa gen-dh`.

Finally, copy the necessary files to the `/etc/openvpn` directory: `sudo cp ta.key pki/ca.crt pki/private/vpnserver.key pki/issued/vpnserver.crt` and `dh.pem`. By completing these steps, you'll have a fully functional OpenVPN server ready to issue client certificates for secure, encrypted connections.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

More from Wednesday 9 September →