Skip to main content

Description

The infisical pam command provides privileged access management capabilities for securely accessing databases, SSH servers, Kubernetes clusters, and Redis instances through Infisical’s Gateway. All PAM commands require the user to be logged in via infisical login.

Command Structure

Subcommands & flags

infisical pam db

Access PAM database accounts. Starts a local database proxy server that you can use to connect to databases directly (PostgreSQL, MySQL, MS SQL Server).

Flags

Name of the PAM resource to access.
Name of the account within the resource.
Project ID of the account to access. If not provided, uses the project from .infisical.json (run infisical init to configure).
Duration for database access session. Supports Go duration format (e.g., 1h, 30m, 2h30m).Default value: 1h
Port for the local database proxy server. Use 0 for auto-assign.Default value: 0
Domain of your self-hosted Infisical instance. If not specified, defaults to Infisical Cloud.

Output

The command displays a connection string based on the database type:
Access PAM SSH accounts. Provides interactive sessions, single command execution, and proxy mode for file transfers.

Subcommands

Start an interactive SSH session to a PAM-managed SSH account. This command automatically launches an SSH client connected through the Infisical Gateway.
Execute a single command on a PAM-managed SSH account and return the output. This is useful for CI/CD pipelines and scripting where interactive sessions are not needed.
The exit code from the remote command is propagated to the CLI exit code, making this suitable for scripts that check command success.
Start an SSH proxy without launching an interactive session. This is useful for file transfers using SCP, SFTP, rsync, or other SSH-based tools. The proxy prints connection details and waits until terminated with Ctrl+C.

Using the Proxy

In another terminal, use the proxy for file transfers:

Flags

All SSH subcommands share the following flags:
Name of the PAM resource to access.
Name of the account within the resource.
Project ID of the account to access. If not provided, uses the project from .infisical.json.
Duration for SSH access session. Supports Go duration format (e.g., 1h, 30m, 2h30m).Default value: 1h
Port for the local SSH proxy server (only applies to proxy subcommand). Use 0 for auto-assign.Default value: 0
Domain of your self-hosted Infisical instance. If not specified, defaults to Infisical Cloud.
Access Kubernetes via a PAM-managed Kubernetes account. This command automatically launches a proxy connected to your Kubernetes cluster through the Infisical Gateway.Alias: infisical pam k8s

Flags

Name of the PAM resource to access.
Name of the account within the resource.
Project ID of the account to access. If not provided, uses the project from .infisical.json.
Duration for Kubernetes access session. Supports Go duration format (e.g., 1h, 30m, 2h30m).Default value: 1h
Port for the local Kubernetes proxy server. Use 0 for auto-assign.Default value: 0
Domain of your self-hosted Infisical instance. If not specified, defaults to Infisical Cloud.
Access PAM Redis accounts. Starts a local Redis proxy server that you can use to connect to Redis directly.

Flags

Name of the PAM resource to access.
Name of the account within the resource.
Project ID of the account to access. If not provided, uses the project from .infisical.json.
Duration for Redis access session. Supports Go duration format (e.g., 1h, 30m, 2h30m).Default value: 1h
Port for the local Redis proxy server. Use 0 for auto-assign.Default value: 0
Domain of your self-hosted Infisical instance. If not specified, defaults to Infisical Cloud.