How It Works
SSH access in Infisical PAM uses a Gateway deployed in your network to establish secure connections to your servers. The Gateway acts as a bridge between Infisical and your private infrastructure.Authentication Methods
Infisical PAM supports three authentication methods for SSH:Certificate-Based Authentication
Certificate-based authentication allows for the use of ephemeral credentials. Infisical generates short-lived SSH certificates on-demand for each session. Benefits:- Ephemeral access: Certificates are generated per-session and expire automatically
- Centralized trust: Servers trust the Infisical CA to authorize connections
- Simplified management: Infisical handles the certificate lifecycle for each connection
- Audit trail: Each certificate is tied to a specific user and session
Prerequisites
Before configuring SSH access in Infisical PAM, ensure you have:- An Infisical Gateway deployed with network reachability to your SSH servers
- Network connectivity from the Gateway to your SSH servers on port 22 (or custom SSH port)
- SSH server credentials (password, private key, or CA setup for certificate auth)
Create the PAM Resource
The PAM Resource represents the SSH server you want to protect.1
Navigate to Resources
Go to your PAM project and click on the Resources tab.
2
Add SSH Resource
Click Add Resource and select SSH.
3
Configure Connection Details
Fill in the connection details:
string
required
A friendly name for this resource (e.g.,
production-server, bastion-host)string
required
Select the Gateway that has network access to this SSH server
string
required
The hostname or IP address of the SSH server (e.g.,
192.168.1.100 or server.internal.example.com)number
required
The SSH port (default:
22)4
Create the Resource
Click Create Resource. Infisical will validate that the Gateway can reach the SSH server.
Create PAM Accounts
A PAM Account represents a specific user account on the SSH server. You can create multiple accounts per resource with different authentication methods.Password Authentication
1
Navigate to Resource
Go to the Resources tab in your PAM project and open your SSH resource.
2
Add Account
Click Add Account.
SSH Key Authentication
1
Add Account
Click Add Account and select your SSH resource.
Certificate Authentication
Certificate authentication requires additional setup on your SSH server to trust the Infisical CA.1
Configure the SSH Server
Before creating the account, you need to configure your SSH server to trust certificates signed by Infisical.Run the following command on your SSH server (requires root/sudo):This script will:
- Download the CA public key for your SSH resource
- Save it to
/etc/ssh/infisical_ca.pub - Add
TrustedUserCAKeys /etc/ssh/infisical_ca.pubto/etc/ssh/sshd_config - Validate and restart the SSH service
First-time setup: The CA key pair is generated automatically when you first call the setup endpoint. Subsequent calls will return the same CA public key.
2
Add Account in Infisical
string
required
A friendly name for this account
string
required
Select Certificate
string
required
The SSH username that the certificate will be issued for. This user must exist on the SSH server.
Unlike password or key authentication, you don’t need to provide any credentials. Infisical will generate a new key pair and certificate for each session.
Access SSH Servers
Once your resource and accounts are configured, users can access SSH servers through the Infisical CLI.1
Install the CLI
If you haven’t already, install the Infisical CLI:
2
Login to Infisical
3
Connect to SSH Server
Specify the resource name and account name as shown in Infisical:For example, to access the account
ubuntu-admin on the resource production-server: