Description
Open one PAM-managed account for your own use, brokered through Infisical’s Gateway so you never handle its credentials. Requiresinfisical login.
The CLI connects to the gateway from your own machine, which means you need a network path to it. A gateway in relay mode works from anywhere, because the relay is reachable from outside your network. A gateway in direct listen mode only works from a machine that can reach its registered address. From outside that network you’ll need a VPN into it, or a relay on the gateway.
This single command handles every account type: the CLI adapts its behavior to whichever type the account’s template defines (see Account Types and Behavior below).
SSH accounts connect you directly to a shell on the target. Every other account type starts a local proxy or credential helper that you point your own client at.
To open several accounts at once for an AI agent, use
infisical pam agentic access instead, which can also authenticate as a machine identity so an agent can run unattended.Arguments
Flags
--proxy
--proxy
Start a local proxy to point your own client at, instead of connecting you to the target.Only SSH accounts connect directly today, so this only changes behavior for them. Use it for SCP, SFTP, rsync, port forwarding, GUI clients, or anything that needs your
~/.ssh/config.--duration
--duration
Session duration. Supports Go duration format (e.g.,
1h, 30m, 2h30m).Default value: 1h--reason
--reason
Audit reason for access. Required by some policies; prompts interactively if TTY available.
--port
--port
Local proxy port. Use
0 for auto-assign.For SSH accounts this requires --proxy, since a port is only meaningful when a proxy is running.Default value: 0--target
--target
Target host for multi-host accounts (e.g., Windows AD environments).
--domain
--domain
Domain of your self-hosted Infisical instance. If not specified, defaults to Infisical Cloud.
Account types and behavior
Based on the account’s template, the CLI connects you directly or starts the appropriate local proxy or credential helper. SSH accounts connect directly by default; every other type starts a proxy or credential helper.Databases (PostgreSQL, MySQL, SQL Server, MongoDB)
Databases (PostgreSQL, MySQL, SQL Server, MongoDB)
Starts a local database proxy on The output includes connection details and CLI examples:
127.0.0.1. Connect using standard database clients — no password required as authentication is handled by the proxy.Redis
Redis
Starts a local Redis proxy on Then connect with Connection string format:
127.0.0.1. Connect using any Redis client with no password, as authentication is handled by the proxy.redis-cli or any Redis client:redis://127.0.0.1:<port>SSH
SSH
Connects you straight to a shell on the target.Type Use your own clientThen connect to the port it prints:
exit or press Ctrl+D to end the session. The remote shell’s exit code becomes the command’s exit code.Run a single commandPut it after --. Output streams through, so this composes with pipes and scripts:--proxy starts a local SSH proxy instead, for file transfer, port forwarding, ~/.ssh/config, or a GUI client:Kubernetes
Kubernetes
Starts a local Kubernetes proxy and automatically configures kubectl context.kubectl is automatically configured with a context named The original kubeconfig context is restored when the session ends.
infisical-k8s-pam/folder/account-name. Use kubectl normally:AWS IAM
AWS IAM
Writes temporary STS credentials to your AWS credentials file (The credentials are written as a named profile: The session blocks until
~/.aws/credentials or wherever AWS_SHARED_CREDENTIALS_FILE points).infisical-pam/folder/account-nameUse with the AWS CLI:Ctrl+C or credential expiry. When the session ends, the profile is removed from the credentials file.GCP Service Account
GCP Service Account
Starts a local proxy on Run The session blocks until
127.0.0.1 and automatically configures gcloud to route through it (via the proxy/*, auth/access_token_file, and core/custom_ca_certs_file config properties). Requires the gcloud CLI to be installed. All traffic is proxied through the Infisical Gateway, which injects the brokered credentials before forwarding to googleapis.com.gcloud and other Google Cloud tooling as normal — no per-command configuration needed:Ctrl+C or expiry. On shutdown, your gcloud configuration is restored.Azure CLI
Azure CLI
Starts an isolated, authenticated Run Type
az shell for the session (using a temporary AZURE_CONFIG_DIR, so your own az login is untouched). Requires the Azure CLI (az) to be installed. All traffic is proxied through the Infisical Gateway, which injects the brokered token before forwarding to management.azure.com.az as normal inside the session shell:exit to end the session (or press Ctrl+C, or wait for expiry). The isolated session state is wiped on shutdown.Windows / RDP
Windows / RDP
Starts a local RDP proxy. Connect your RDP client to Connect using your preferred RDP client (e.g., Microsoft Remote Desktop, xfreerdp, Remmina).
127.0.0.1 on the assigned port.MFA support
If your organization requires MFA for PAM access:- CLI detects
SESSION_MFA_REQUIREDresponse - Browser opens to MFA verification page
- CLI polls for up to 5 minutes for completion
- Access continues automatically after MFA verification
This is the only command that can satisfy an MFA requirement.
pam agentic access doesn’t support MFA-gated accounts yet, so reach those here.