Skip to content

About

Enable connecting to PIA through the NetworkManager GUI (with support for port forwarding)

Resources

Security policy

Stars

11 stars

Watchers

1 watching

Forks

Repository files navigation

PIA-NetworkManager-GUI-Support

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.

PIA Obfuscation Support (Shadowsocks)

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.


Repository Files

  • pia_NM_profiles_install.sh (v1.2) — Downloads PIA's v6 server list, OpenVPN CA certificates, and Next-Gen port-forwarding CA certificate, and installs .nmconnection OpenVPN profiles into /etc/NetworkManager/system-connections/.
  • get_region_and_token_NM_GUI.sh (v1.4) — Detects your active PIApf-* NetworkManager VPN connection, requests an authentication token from PIA's API (/api/client/v2/token), and automatically launches port_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-run port_forwarding.sh directly if needed.
  • ca.rsa.4096.crt — PIA's Next-Gen root CA certificate downloaded automatically by pia_NM_profiles_install.sh from PIA's official pia-foss/manual-connections repository. Used locally by port_forwarding.sh to 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's v6 server JSON saved during profile installation so get_region_and_token_NM_GUI.sh can match your installed profile to its server metadata.
  • /root/.pia-auth (optional) — Manually created 2-line plain-text file owned by root (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'
  • README.md — This documentation file.

Prerequisites

  1. Private Internet Access (PIA) Account & sudo/root Access: Required to authenticate with PIA's API and write profiles to /etc/NetworkManager/system-connections/.
  2. NetworkManager & OpenVPN: NetworkManager (nmcli), openvpn, and the NetworkManager OpenVPN plugin (NetworkManager-openvpn on Fedora/RHEL or network-manager-openvpn on Debian/Ubuntu).
  3. CLI Utilities: curl, jq, uuidgen (util-linux), and ip (iproute / iproute2).
  4. [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.

Usage

1. Install NetworkManager Profiles

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 Y for port forwarding installs profiles prefixed with PIApf- (filtering only regions that support port forwarding and are online).
  • Selecting n for port forwarding installs profiles prefixed with PIA-.
  • Both sets can coexist side-by-side in NetworkManager.

2. Verify & Connect via NetworkManager GUI

  1. Verify the .nmconnection files were created:
    ls /etc/NetworkManager/system-connections/PIA*
  2. Open your desktop NetworkManager GUI, select a PIA profile, and connect.
  3. Confirm the active connection from the terminal:
    nmcli connection show --active

3. Enable Port Forwarding (Optional)

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.sh

Leave the terminal running (or run it inside tmux / screen) so port_forwarding.sh can refresh the port binding every 15 minutes.


Troubleshooting

  • 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.sh to refresh the v6 server list.
  • Profiles do not appear in the GUI immediately:
    • Reload NetworkManager connections manually:
      sudo nmcli connection reload
  • Debugging token or port-forwarding requests:
    • Both get_region_and_token_NM_GUI.sh and port_forwarding.sh print the exact curl commands they execute. You can copy the printed command, replace -s with -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.sh will automatically detect the new CN= from curl output and retry getSignature.

Version History

2026-11-29 20:36 GMT

  • v2.0.1 — Credential Standardization & PIA-OC Resilience Updates
    • Removed all references to ./.pia-credentials and standardized optional credential loading strictly on /root/.pia-auth (chmod 600) across pia_NM_profiles_install.sh (v1.2) and get_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-OC Toolkit (./PIA-OC/): Added keepalive 10 30 to PIA-OC-Template.ovpn for automatic recovery from silent upstream TCP :443 stalls, optional LOG_SS_DROPS logging in OpenVPN-OC-up.sh, diagnose-OC.sh for live layered troubleshooting, and ./PIA-OC/extras/ (99-pia-oc-route link-recovery dispatcher + hardware troubleshooting notes).
  • v2.0.0 — Added PIA-OC OpenVPN-over-Shadowsocks Obfuscation Toolkit
    • Added standalone CLI obfuscation scripts, configuration templates, and documentation under ./PIA-OC/.

2026-11-21 00:59 GMT

  • Migrated continuing version history from ReleaseNotes-C.txt into README.md.
  • pia_NM_profiles_install.sh (v1.1)
    • Updated server list endpoint from v5 to v6 (pia-v6-at-install.dat) and filtered out offline regions.
    • Downloaded PIA's Next-Gen ca.rsa.4096.crt from pia-foss/manual-connections for port forwarding while keeping OpenVPN CA certificates separate under /etc/openvpn/.
    • Generated modern .nmconnection profile files with scoped prefix cleanup (PIA-* vs. PIApf-*) so both profile sets can coexist.
    • Added runtime dependency checks (curl, jq, nmcli, uuidgen), enforced chmod 600 on credentials, and removed plain-text password echoing.
  • get_region_and_token_NM_GUI.sh (v1.3)
    • Switched token authentication to PIA's POST /api/client/v2/token endpoint for reliable token generation across all regions.
    • Updated snapshot lookup to /var/log/pia-v6-at-install.dat with slash-sanitized region matching.
    • Improved active PIApf-* VPN profile and gateway detection via nmcli, and redacted passwords from printed debug commands.
  • port_forwarding.sh (v1.3)
    • Replaced eval process substitution with deterministic mktemp stderr capture for getSignature.
    • Hardened CN= certificate subject extraction across OpenSSL/GnuTLS curl builds when handling PIA TLS certificate name drift.
    • Added startup checks for required tools (curl, jq, base64) and ./ca.rsa.4096.crt.

About

Enable connecting to PIA through the NetworkManager GUI (with support for port forwarding)

Resources

Security policy

Stars

11 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages