This repository provides Private Internet Access (PIA) Linux users with NetworkManager GUI OpenVPN profiles and support for PIA's Next-Gen port forwarding.
If you do not require port forwarding, simply run pia_NM_profiles_install.sh (selecting n for port forwarding) and connect using your desktop NetworkManager GUI.
If you're choosing additional privacy and to avoid blocked, and/or throttled, VPN traffic! Note: While this disguises VPN traffic, it doesn't prevent IP tracking by cloud security services. Switching exit-points can leave you with an undocumented (not-yet-tracked) public IP.
Support for PIA Obfuscation has been added under ./PIA-OC. NetworkManager and GNOME do not, at this time, include support for integration into the graphical environment. This support is made available via CL-only. See ./PIA-OC/README.md for additional information.
pia_NM_profiles_install.sh(v1.2) — Downloads PIA'sv6server list, OpenVPN CA certificates, and Next-Gen port-forwarding CA certificate, and installs.nmconnectionOpenVPN profiles into/etc/NetworkManager/system-connections/.get_region_and_token_NM_GUI.sh(v1.4) — Detects your activePIApf-*NetworkManager VPN connection, requests an authentication token from PIA's API (/api/client/v2/token), and automatically launchesport_forwarding.sh.port_forwarding.sh(v1.3) — Requests a port-forwarding signature (getSignature) from the VPN gateway, binds the assigned port (bindPort), and keeps it alive every 15 minutes. It also prints the manual CLI command to re-runport_forwarding.shdirectly if needed.ca.rsa.4096.crt— PIA's Next-Gen root CA certificate downloaded automatically bypia_NM_profiles_install.shfrom PIA's officialpia-foss/manual-connectionsrepository. Used locally byport_forwarding.shto verify TLS connections to the VPN gateway (:19999). (Separate from the OpenVPN CA certificates saved to/etc/openvpn/pia-ca.rsa.*.crt.)/var/log/pia-v6-at-install.dat— Static snapshot of PIA'sv6server JSON saved during profile installation soget_region_and_token_NM_GUI.shcan match your installed profile to its server metadata./root/.pia-auth(optional) — Manually created 2-line plain-text file owned byroot(chmod 600 /root/.pia-auth) containing only your PIA username on line 1 and your PIA password on line 2 (no labels, quotes, or extra blank lines):p1234567 your_pia_password- Quick setup command:
sudo bash -c 'printf "p1234567\nyour_pia_password\n" > /root/.pia-auth && chmod 600 /root/.pia-auth'
- Quick setup command:
README.md— This documentation file.
- Private Internet Access (PIA) Account &
sudo/rootAccess: Required to authenticate with PIA's API and write profiles to/etc/NetworkManager/system-connections/. - NetworkManager & OpenVPN:
NetworkManager(nmcli),openvpn, and the NetworkManager OpenVPN plugin (NetworkManager-openvpnon Fedora/RHEL ornetwork-manager-openvpnon Debian/Ubuntu). - CLI Utilities:
curl,jq,uuidgen(util-linux), andip(iproute/iproute2). - [Optional] Desktop NM-GUI: A desktop NetworkManager applet/GUI (GNOME, KDE Plasma, XFCE, etc.) to select and toggle VPN connections. Command line access (
nmcli) can be used for all NetworkManager interactions.
Make the scripts executable and run the installer as root:
chmod +x pia_NM_profiles_install.sh get_region_and_token_NM_GUI.sh port_forwarding.sh
sudo ./pia_NM_profiles_install.sh- Selecting
Yfor port forwarding installs profiles prefixed withPIApf-(filtering only regions that support port forwarding and are online). - Selecting
nfor port forwarding installs profiles prefixed withPIA-. - Both sets can coexist side-by-side in NetworkManager.
- Verify the
.nmconnectionfiles were created:ls /etc/NetworkManager/system-connections/PIA* - Open your desktop NetworkManager GUI, select a PIA profile, and connect.
- Confirm the active connection from the terminal:
nmcli connection show --active
While connected to a PIApf-* profile (note: PIA does not support port forwarding on US servers), run from the repository directory:
sudo ./get_region_and_token_NM_GUI.shLeave the terminal running (or run it inside tmux / screen) so port_forwarding.sh can refresh the port binding every 15 minutes.
- Profile fails to connect:
- Inspect the generated profile configuration:
sudo less "/etc/NetworkManager/system-connections/<profile-name>.nmconnection" - Ensure your distribution's NetworkManager OpenVPN plugin package is installed (
network-manager-openvpn/NetworkManager-openvpn). - Try another region—an individual server in a static profile may occasionally be offline for maintenance, or re-run
sudo ./pia_NM_profiles_install.shto refresh thev6server list.
- Inspect the generated profile configuration:
- Profiles do not appear in the GUI immediately:
- Reload NetworkManager connections manually:
sudo nmcli connection reload
- Reload NetworkManager connections manually:
- Debugging token or port-forwarding requests:
- Both
get_region_and_token_NM_GUI.shandport_forwarding.shprint the exactcurlcommands they execute. You can copy the printed command, replace-swith-vs(--verbose), and run it manually to inspect TLS or API responses. - If PIA rotates a server's TLS Common Name (
CN=) after install,port_forwarding.shwill automatically detect the newCN=fromcurloutput and retrygetSignature.
- Both
v2.0.1— Credential Standardization &PIA-OCResilience Updates- Removed all references to
./.pia-credentialsand standardized optional credential loading strictly on/root/.pia-auth(chmod 600) acrosspia_NM_profiles_install.sh(v1.2) andget_region_and_token_NM_GUI.sh(v1.4). - Security Notice: Please manually delete any existing
git/PIA-NetworkManager-GUI-Support/.pia-credentials(or./.pia-credentials) file from your working directory—it will not be automatically deleted. PIA-OCToolkit (./PIA-OC/): Addedkeepalive 10 30toPIA-OC-Template.ovpnfor automatic recovery from silent upstream TCP:443stalls, optionalLOG_SS_DROPSlogging inOpenVPN-OC-up.sh,diagnose-OC.shfor live layered troubleshooting, and./PIA-OC/extras/(99-pia-oc-routelink-recovery dispatcher + hardware troubleshooting notes).
- Removed all references to
v2.0.0— AddedPIA-OCOpenVPN-over-Shadowsocks Obfuscation Toolkit- Added standalone CLI obfuscation scripts, configuration templates, and documentation under
./PIA-OC/.
- Added standalone CLI obfuscation scripts, configuration templates, and documentation under
- Migrated continuing version history from
ReleaseNotes-C.txtintoREADME.md. pia_NM_profiles_install.sh(v1.1)- Updated server list endpoint from
v5tov6(pia-v6-at-install.dat) and filtered out offline regions. - Downloaded PIA's Next-Gen
ca.rsa.4096.crtfrompia-foss/manual-connectionsfor port forwarding while keeping OpenVPN CA certificates separate under/etc/openvpn/. - Generated modern
.nmconnectionprofile files with scoped prefix cleanup (PIA-*vs.PIApf-*) so both profile sets can coexist. - Added runtime dependency checks (
curl,jq,nmcli,uuidgen), enforcedchmod 600on credentials, and removed plain-text password echoing.
- Updated server list endpoint from
get_region_and_token_NM_GUI.sh(v1.3)- Switched token authentication to PIA's
POST /api/client/v2/tokenendpoint for reliable token generation across all regions. - Updated snapshot lookup to
/var/log/pia-v6-at-install.datwith slash-sanitized region matching. - Improved active
PIApf-*VPN profile and gateway detection vianmcli, and redacted passwords from printed debug commands.
- Switched token authentication to PIA's
port_forwarding.sh(v1.3)- Replaced
evalprocess substitution with deterministicmktempstderr capture forgetSignature. - Hardened
CN=certificate subject extraction across OpenSSL/GnuTLScurlbuilds when handling PIA TLS certificate name drift. - Added startup checks for required tools (
curl,jq,base64) and./ca.rsa.4096.crt.
- Replaced