Skip to content

Bastion Host Integration

Configure SSH-KLM to work with traditional bastion hosts and jump servers.

  • Bastion host with SSH access
  • SSH-KLM agent installed on bastion
  • Network connectivity from bastion to target hosts
Terminal window
curl -fsSL https://get.qcecuring.com/ssh-agent | sudo bash -s -- \
--server https://ssh-klm.example.com \
--token YOUR_TOKEN \
--mode bastion
/etc/ssh-klm-agent/config.yaml
agent:
mode: bastion
bastion:
enabled: true
discoverTargets: true
targetNetworks:
- 10.0.0.0/8
- 172.16.0.0/12
# SSH config for reaching targets
ssh:
user: sshklm-scanner
keyFile: /etc/ssh-klm-agent/scanner_key
timeout: 30s
// Register hosts behind bastion
await client.ssh.addHost({
hostname: 'internal-server-01',
port: 22,
bastion: 'bastion.example.com',
labels: { environment: 'production' }
});
// Discovery uses bastion as proxy
const scan = await client.ssh.startDiscovery({
hosts: ['internal-*'],
viaBastion: 'bastion.example.com'
});

Key rotation automatically uses the bastion:

await client.ssh.rotateKey({
keyId: 'KEY-internal-123',
// Automatically routes through configured bastion
});
Terminal window
# Test from bastion
ssh -v internal-server-01
# Check agent logs
sudo journalctl -u ssh-klm-agent | grep bastion

Increase timeout for large networks:

bastion:
ssh:
timeout: 60s
discovery:
parallelHosts: 5