SSH-KLM Quickstart
SSH-KLM Quickstart
Section titled “SSH-KLM Quickstart”Get SSH-KLM running in 5 minutes and discover your first SSH keys.
This guide walks you through deploying SSH-KLM locally, running your first discovery scan, and viewing discovered keys in the dashboard.
Use Cases
Section titled “Use Cases”- Evaluate SSH-KLM features quickly
- Development and testing environments
- Proof of concept deployments
- Learning the platform before production rollout
Prerequisites
Section titled “Prerequisites”| Requirement | Details |
|---|---|
| Docker | Version 20.10+ with Docker Compose |
| Ports | 8081 (UI), 5432 (PostgreSQL), 6379 (Redis) |
| Memory | Minimum 4GB RAM available |
| Target Server | SSH access to at least one Linux server (for testing) |
Step-by-Step Guide
Section titled “Step-by-Step Guide”Step 1: Clone and Start Services
Section titled “Step 1: Clone and Start Services”# Clone the repositorygit clone https://github.com/qcecuring/ssh-klm.gitcd ssh-klm
# Start all servicesdocker-compose up -d
# Verify services are runningdocker-compose psExpected output:
NAME STATUS PORTSssh-klm-api Up 0.0.0.0:8081->8081/tcpssh-klm-db Up 0.0.0.0:5432->5432/tcpssh-klm-redis Up 0.0.0.0:6379->6379/tcpssh-klm-worker UpStep 2: Access the Dashboard
Section titled “Step 2: Access the Dashboard”- Open http://localhost:8081 in your browser
- Login with default credentials:
- Username:
admin@qcecuring.local - Password:
changeme123
- Username:
- Important: Change the default password immediately
Step 3: Add Your First Host
Section titled “Step 3: Add Your First Host”Navigate to Inventory → Add Host and enter:
Host: server01.example.comPort: 22Username: root # or your SSH userAuthentication: Password # or SSH KeyAlternatively, use the SDK:
import { QcClient } from '@qcecuring/ssh-sdk';
const client = new QcClient({ apiKey: process.env.QC_API_KEY, baseUrl: 'http://localhost:8081'});
// Add a hostawait client.ssh.addHost({ hostname: 'server01.example.com', port: 22, username: 'root', authMethod: 'password', credential: process.env.SSH_PASSWORD});Step 4: Run Discovery Scan
Section titled “Step 4: Run Discovery Scan”- Go to Discovery → New Scan
- Select your host from the inventory
- Click Start Discovery
Or via SDK:
// Trigger discoveryconst scan = await client.ssh.startDiscovery({ hosts: ['server01.example.com'], scanType: 'full' // 'full' | 'incremental'});
console.log(`Scan started: ${scan.id}`);Step 5: View Discovered Keys
Section titled “Step 5: View Discovered Keys”After the scan completes (typically 1-2 minutes):
- Navigate to Keys → All Keys
- View discovered SSH keys with details:
- Key fingerprint
- Algorithm (RSA, ED25519, ECDSA)
- Key age and last used
- Risk score
// List discovered keysconst keys = await client.ssh.listKeys({ host: 'server01.example.com', status: 'active'});
keys.forEach(key => { console.log(`${key.fingerprint} - ${key.algorithm} - Risk: ${key.riskScore}`);});Step 6: Rotate a Key (Optional)
Section titled “Step 6: Rotate a Key (Optional)”Test key rotation on a non-production key:
- Select a key from the list
- Click Actions → Rotate Key
- Choose rotation options:
- Generate new key pair
- Update authorized_keys
- Archive old key
// Rotate a specific keyawait client.ssh.rotateKey({ keyId: 'KEY-12345', algorithm: 'ed25519', archiveOld: true});Examples
Section titled “Examples”Complete Discovery Flow
Section titled “Complete Discovery Flow”import { QcClient } from '@qcecuring/ssh-sdk';
async function discoverAndReport() { const client = new QcClient({ apiKey: process.env.QC_API_KEY });
// Add hosts const hosts = ['server01', 'server02', 'server03']; for (const host of hosts) { await client.ssh.addHost({ hostname: `${host}.example.com` }); }
// Run discovery const scan = await client.ssh.startDiscovery({ hosts: hosts.map(h => `${h}.example.com`) });
// Wait for completion await client.ssh.waitForScan(scan.id);
// Get results const keys = await client.ssh.listKeys({ scanId: scan.id });
console.log(`Discovered ${keys.length} SSH keys`); console.log(`High risk keys: ${keys.filter(k => k.riskScore > 80).length}`);}Troubleshooting
Section titled “Troubleshooting”Services Not Starting
Section titled “Services Not Starting”Issue: Docker containers fail to start
Solution:
# Check logsdocker-compose logs -f
# Restart servicesdocker-compose downdocker-compose up -dCannot Connect to Host
Section titled “Cannot Connect to Host”Issue: Discovery fails with connection error
Solution:
- Verify SSH port (22) is accessible
- Check firewall rules
- Validate credentials
- Test manually:
ssh user@host
Discovery Returns No Keys
Section titled “Discovery Returns No Keys”Issue: Scan completes but no keys found
Solution:
- Verify user has permission to read
~/.ssh/and/etc/ssh/ - Check scan logs in Discovery → Scan History
- Try running with elevated privileges
Next Steps
Section titled “Next Steps”Now that you have SSH-KLM running:
| Guide | Description |
|---|---|
| Docker Installation | Production Docker deployment |
| Kubernetes Setup | Deploy on K8s |
| Discovery Concepts | How discovery works |
| Rotation Policies | Configure automated rotation |
| API Overview | Full API documentation |