PassTunnel
Connect your VPN without ever typing a one-time code again.
PassTunnel is an open-source macOS app for OpenVPN, FortiGate SSL VPN, Cisco AnyConnect and Palo Alto GlobalProtect (experimental). It keeps
your TOTP secret in the Keychain and fills in the current code (and your password) every time you connect.
Website ·
Features ·
Install ·
Quick start ·
Code format ·
Cisco AnyConnect ·
Palo Alto GlobalProtect ·
CLI ·
AI assistants ·
FAQ ·
Security ·
Project ·
Türkçe
Features
One-time codes, handled
- No more typing codes. The TOTP secret lives in the macOS Keychain; PassTunnel generates the
code and sends it with your password when you click Connect. If 5 seconds or less are left in
the current window, it waits for a fresh code instead of racing the clock (a setting, on by
default). A code that was already sent is never sent again.
- Any format your server expects. Append, prepend,
password:code, password,code, or a custom
template with any literal text, or send the code separately (OpenVPN static challenge, FortiGate
OTP field, Cisco AnyConnect's second password field). See Configuring the code format.
- Authenticator-style main window. The sidebar lists every profile with its state and live code;
the selected one shows its code in large digits with a countdown ring, and what the server
receives. Click the code to copy; the clipboard is cleared again after 1 minute (or 30 seconds, or
2 minutes, in Settings), unless you copied something else meanwhile. Codes can be hidden until
you click them.
- QR import. Drop a screenshot of your provider's QR code, choose an image or paste from the
clipboard, or (macOS 14 and later) scan the QR code where it is on screen, for example in your
browser, without saving a screenshot. Digits, period and algorithm (SHA-1/256/512) are read from the
otpauth:// link. Pasting a Base32 secret or an otpauth:// link works too.
- Auto-type (optional, off by default). With global shortcuts on, ⌃⌥C types the current code into
the focused field (also in the menu bar panel), for web portals and other places that still ask for it. Needs Accessibility
permission, which is only requested when you turn the feature on.
- Confirm with Touch ID (optional, per profile). Touch ID or your Mac password before connecting
and before showing codes (the command line can also set it to ask before connecting only); the saved
secrets are then encrypted with a key in the Mac's Secure Enclave, so a one-click connect needs you,
not just your unlocked Mac.
VPN client
- OpenVPN, FortiGate SSL VPN, Cisco AnyConnect and Palo Alto GlobalProtect (experimental), using
bundled, signed copies of
openvpn, openfortivpn and openconnect. Nothing else to install. Cisco
AnyConnect and Palo Alto GlobalProtect (password and one-time code) need macOS 15.4 or later; see
Cisco AnyConnect and Palo Alto GlobalProtect.
- Menu bar panel. Every pinned or active profile with its state, live code and a switch to
connect or disconnect, plus copy and type for the current code. A colored badge (five palettes)
marks a profile that needs attention, with a red dot when a connection dropped unexpectedly.
- Stays connected. Optional auto-reconnect with backoff, a health check host inside the VPN,
reconnect after wake, chosen profiles connected at login, and a reminder before a server-side
session limit runs out.
- Several VPNs at once, each with its own status, log and settings.
- Shareable profiles. Export a
.passtunnel file for your team. It never contains passwords,
TOTP secrets or user names.
- Command-line tool.
passtunnel connect, passtunnel code -c, --json output, stable exit
codes and shell completions: the same features as the app.
- Works with AI assistants.
passtunnel mcp is an MCP server, so Claude Code, Claude Desktop
and other MCP clients can check your VPNs, read logs and diagnose problems. Read-only unless
you allow connecting, and it never hands out passwords, secrets or codes.
- No sudoers rule, no admin password at every connect. A small privileged helper, registered
through macOS's own
SMAppService and approved once, runs only the VPN tools signed and shipped
inside the app, with sanitized configurations. See SECURITY.md.
- English and Turkish user interface (follows your macOS language).
How it works
PassTunnel.app ──XPC──▶ PassTunnelHelper (root) ──▶ bundled openvpn / openfortivpn / openconnect
│ (code-signature checked) │
├─ Keychain: password + TOTP secret └─ management socket (OpenVPN),
└─ ~/Library/Application Support/PassTunnel log file, status ──▶ back to the app
- You click Connect. The app reads your password and TOTP secret from the Keychain, computes
the current code and builds what the server expects (for example
secret123456).
- The app hands the request to the privileged helper over XPC. The helper accepts only the signed
PassTunnel app, checks that the profile folder belongs to you, sanitizes the OpenVPN config (or
writes the openfortivpn config itself from typed fields) and starts the bundled tool, which it
lets run only after checking the signature of the code that was actually loaded. For Cisco
AnyConnect, the app signs in first (as you, not as root) and hands the helper only the resulting
session cookie, which the helper uses to build the
openconnect configuration itself.
- The app follows the connection state (OpenVPN through a management socket that only your user
can open, FortiGate and Cisco AnyConnect through the log) and shows it in the window and the menu bar.
The full security model, including what is not protected, is in SECURITY.md. The
code layout is described in docs/ARCHITECTURE.md.
Install
Requires macOS 13 Ventura or later on a Mac with Apple silicon. Cisco AnyConnect and Palo Alto GlobalProtect profiles
need macOS 15.4 or later; on an older macOS the rest of the app works as usual.
Download
Download the disk image,
open it and drag PassTunnel to Applications. Launch it from there: the helper can only be
installed from the Applications folder. The app is signed with a Developer ID and notarized by
Apple. What changed is in the
release notes.
PassTunnel keeps itself up to date (Settings → Updates); updates are signed and checked before
they are installed. After an update, the helper is updated automatically as soon as no VPN
connection is active (only when PassTunnel runs from the Applications folder).
Homebrew
brew trust passtunnel/tap
brew install --cask passtunnel/tap/passtunnel
Since Homebrew 6, casks from third-party taps load only once you trust the tap, hence the first
line. The cask also links the passtunnel command. Updates arrive through the app itself, so
brew upgrade leaves it alone unless you run brew upgrade --greedy.
Build from source
You need Xcode 15.3 or later (Swift 5.10, plus xcstringstool for the Turkish strings) and
Homebrew, which provides the VPN tools that get bundled into the app:
brew install openvpn openfortivpn openconnect
git clone https://github.com/passtunnel/passtunnel.git
cd passtunnel
scripts/build-app.sh # → build/PassTunnel.app (ad-hoc signed)
build-app.sh builds a release binary, assembles the bundle, copies openvpn, openfortivpn,
openconnect (Cisco AnyConnect, Palo Alto GlobalProtect) and their libraries in (scripts/bundle-tools.sh, with their license files), compiles the helper with
the code-signature hashes of exactly these tools and libraries, and signs everything inside-out with
the hardened runtime. An ad-hoc build signs the app without library validation: an ad-hoc signature
has no Team ID, so macOS would otherwise refuse to load Sparkle.framework into it.
[!IMPORTANT]
The helper only talks to an app, and only runs tools, signed with the project's Developer ID Team ID.
An ad-hoc build is fine for the window, codes, QR import, profiles and the CLI, but cannot
connect. To connect with your own build, set teamID in
Sources/PassTunnelShared/Identifiers.swift to your
Team ID and sign with your certificate:
scripts/build-app.sh --sign "Developer ID Application: Your Name (TEAMID)"
Then move build/PassTunnel.app to /Applications before installing the helper.
Quick start
Without any profile, the window opens on Add your first VPN:
- Install the helper. The card at the bottom explains what it is for. Click Install Helper,
then turn PassTunnel on in System Settings → General → Login Items (macOS asks once). You
can also do this later from Settings → Helper. If you check Install and repair the helper
automatically (off by default), PassTunnel installs it now, or on its own the first time you
connect without it after opening PassTunnel, and connects if you approve it within 5 minutes;
macOS still asks in Login Items.
- Add a VPN. Drop a file on the dashed area, or pick one of the other ways in.
Add a profile
Click + at the bottom of the sidebar (the same view, titled Add a VPN), or drop a file onto
the window. The File menu has the same items:
| You have… |
Do this |
An OpenVPN file (.ovpn / .conf) |
Drop it on the dashed area or Choose File… (File → Import .ovpn…). You see a review of what is in the file before anything is saved; files it references (ca ca.crt, tls-auth ta.key 1, …) are embedded automatically. |
| A FortiGate gateway |
Enter details by hand, choose FortiGate (File → New FortiGate Profile…), then enter host and port and Fetch fingerprint to pin the gateway certificate (SHA-256). |
A .passtunnel file from a colleague |
Double-click it (or open it from AirDrop), or drop it on the window. Then add your own user name, password and TOTP secret. |
| A Cisco AnyConnect server |
Enter details by hand, choose Cisco AnyConnect (File → New Cisco AnyConnect Profile…), then paste the address your IT team gave you, for example https://vpn.example.com/staff. See Cisco AnyConnect. |
| A Palo Alto GlobalProtect portal (experimental) |
Enter details by hand, choose Palo Alto GlobalProtect (File → New Palo Alto GlobalProtect Profile (Experimental)…), then enter the portal's address, for example vpn.example.com. See Palo Alto GlobalProtect. |
| A QR code for your authenticator |
Scan a QR code on screen (macOS 14 and later) or Use a QR image, or drop the screenshot onto the window or the editor. |
Then open the profile editor (Edit in the toolbar):
- First card (no heading): name, user name (leave empty to be asked each time) and password, saved in the Keychain.
Under Advanced the password can be asked each time instead, or not used (certificate-only OpenVPN).
- One-time code: Scan QR on screen (macOS 14 and later), choose the QR code image or paste the
secret (or drop the screenshot on the card),
and compare the live code with your phone before saving. Code format sets how the code is sent;
Server receives shows the result, with the password masked. Under Advanced the code can be asked
each time or not used.
Secrets are written to the Keychain only when you press Save.
Connect
Click Connect. If the profile needs something that is not stored (for example, a password set to
Ask each time), a small sheet asks for just that, with the code already filled in.
Select a profile in the sidebar and click Connect; a failure explains what went wrong and
offers Try again. The menu bar panel does the same from anywhere: a switch per pinned or active
profile, with its live code, and copy items for the current code (Type code too while auto-type is on):
Optional global shortcuts (Settings → Shortcuts, off by default): ⌃⌥V connects or
disconnects the default profile, ⌃⌥C copies the current code, or types it when auto-type is on.
Configuring the code format
Servers disagree on how the one-time code should arrive. Choose it per profile in the editor's
Code format popup.
With the password (Append, Prepend, password:code, password,code, Custom template): the code and
password are joined into one password using a template. {password} and {otp} are replaced; any other text is sent as typed. The template must
contain {otp}; {password} is optional.
With the password secret and the code 123456:
| Format |
Template |
Sent as password |
| Append (default) |
{password}{otp} |
secret123456 |
| Prepend |
{otp}{password} |
123456secret |
| Password:code |
{password}:{otp} |
secret:123456 |
| Password,code |
{password},{otp} |
secret,123456 |
| Custom |
{password}#{otp} |
secret#123456 |
| Custom (code only) |
{otp} |
123456 |
Sent separately: the password and the code are sent on their own:
- OpenVPN: as a static-challenge response (
SCRV1:…). PassTunnel selects this automatically
when the imported .ovpn contains static-challenge.
- FortiGate: in openfortivpn's separate OTP field. This is the default for new FortiGate
profiles.
- Cisco AnyConnect: as the answer to the server's second password field. This is the default for
new Cisco AnyConnect profiles; for a server that wants one field, choose a format that joins them.
As you change the format, the editor's Server receives shows the result with the profile's user
name and the live code; the password is always masked.
Cisco AnyConnect
PassTunnel connects to servers that speak the Cisco AnyConnect protocol through the bundled
openconnect, with a user name, a password and, if the server asks for one, a one-time code. It needs
macOS 15.4 or later; the rest of the app still runs on macOS 13.