Vynx is a lightweight CLI tool that helps you connect to OpenVPN servers using TOTP-based dynamic passwords (2FA). It eliminates the hassle of manually opening your authenticator app and entering the OTP every time you connect.
- 🔒 Secure TOTP (RFC 6238) password generation
- ⚡ One-command VPN connection
- 📁 Encrypted configuration stored locally
- 🧰 Easily scriptable for DevOps or remote access workflows
- A valid
.ovpnconfiguration file - Golang (only required to build from source)
- OpenVPN installed and accessible from the command line
For macOS:
brew install openvpnFor Linux:
sudo apt-get install openvpnClone and build the tool:
git clone https://github.com/vukyn/vynx.git
cd vynx
make gen-seckey
make buildIf you already have a .env and just want to update AES_KEY:
make gen-seckeyMake the binary available system-wide:
make installDownload the binary from the releases page.
Run the following command to automatically generate the OTP and connect to the VPN:
$ vynxNOTE: Make sure you have the openvpn profile in the same directory as the .ovpn file
To initialize or update your configuration:
$ vynx myusername mytotpsecret- myusername: Your VPN login username
- mytotpsecret: The Base32-encoded TOTP secret (e.g., from your authenticator app)
This will create or update vpn_config.json with your credentials.
Vynx uses the following workflow:
-
Your secret and username are stored (with encryption).
-
When invoked, Vynx:
- Reads the local vpn_config.json
- Generates a current TOTP value (30-second window)
- Creates a temporary file containing username\npassword
- Launches OpenVPN using your .ovpn file and the temp credentials
-
The credentials file is deleted automatically after use.
- vpn_config.json is encrypted and should be protected as sensitive information.
- No TOTP secret or password is ever printed or stored in plain text.
- The tool deletes temporary authentication files after execution.
This project is licensed under the MIT License.