Description
Theinfisical 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
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
--resource
--resource
Name of the PAM resource to access.
--account
--account
Name of the account within the resource.
--project-id
--project-id
Project ID of the account to access. If not provided, uses the project from
.infisical.json (run infisical init to configure).--duration
--duration
Duration for database access session. Supports Go duration format (e.g.,
1h, 30m, 2h30m).Default value: 1h--port
--port
Port for the local database proxy server. Use
0 for auto-assign.Default value: 0--domain
--domain
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:| Database Type | Connection String Format |
|---|---|
| PostgreSQL | postgres://<username>@localhost:<port>/<database> |
| MySQL | mysql://<username>@localhost:<port>/<database> |
| MS SQL Server | sqlserver://<username>@localhost:<port>?database=<database>&encrypt=false&trustServerCertificate=true |
infisical pam ssh
infisical pam ssh
Access PAM SSH accounts. Provides interactive sessions, single command execution, and proxy mode for file transfers.
Subcommands
access
access
Start an interactive SSH session to a PAM-managed SSH account. This command automatically launches an SSH client connected through the Infisical Gateway.
exec
exec
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.
| Argument | Description |
|---|---|
command | The command to execute on the remote server (passed as first argument) |
proxy
proxy
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:--resource
--resource
Name of the PAM resource to access.
--account
--account
Name of the account within the resource.
--project-id
--project-id
Project ID of the account to access. If not provided, uses the project from
.infisical.json.--duration
--duration
Duration for SSH access session. Supports Go duration format (e.g.,
1h, 30m, 2h30m).Default value: 1h--port
--port
Port for the local SSH proxy server (only applies to
proxy subcommand). Use 0 for auto-assign.Default value: 0--domain
--domain
Domain of your self-hosted Infisical instance. If not specified, defaults to Infisical Cloud.
infisical pam kubernetes
infisical pam kubernetes
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 k8sFlags
--resource
--resource
Name of the PAM resource to access.
--account
--account
Name of the account within the resource.
--project-id
--project-id
Project ID of the account to access. If not provided, uses the project from
.infisical.json.--duration
--duration
Duration for Kubernetes access session. Supports Go duration format (e.g.,
1h, 30m, 2h30m).Default value: 1h--port
--port
Port for the local Kubernetes proxy server. Use
0 for auto-assign.Default value: 0--domain
--domain
Domain of your self-hosted Infisical instance. If not specified, defaults to Infisical Cloud.
infisical pam redis
infisical pam redis
Access PAM Redis accounts. Starts a local Redis proxy server that you can use to connect to Redis directly.
Flags
--resource
--resource
Name of the PAM resource to access.
--account
--account
Name of the account within the resource.
--project-id
--project-id
Project ID of the account to access. If not provided, uses the project from
.infisical.json.--duration
--duration
Duration for Redis access session. Supports Go duration format (e.g.,
1h, 30m, 2h30m).Default value: 1h--port
--port
Port for the local Redis proxy server. Use
0 for auto-assign.Default value: 0--domain
--domain
Domain of your self-hosted Infisical instance. If not specified, defaults to Infisical Cloud.