SSH Credentials
Overview
SSH credentials are used to authenticate when connecting to managed hosts. The platform supports two types of authentication:
- Password - Username and password
- SSH Key - Username and private key
Managing Credentials
Accessing Credential Manager
- Go to Hosts page
- Click Manage Credentials button
- The credential management modal opens
Creating a Credential
- Click Add New Credential
- Fill in the fields:
| Field | Description |
|---|---|
| Credential Name | Descriptive name (e.g., “Production SSH Key”) |
| Type | Password or SSH Key |
| Username | SSH username (e.g., root, ubuntu) |
| Password | (For password type) SSH password |
| Private Key | (For SSH key type) Full private key content |
- Click Create
Password Authentication
For password-based authentication:
- Select Password type
- Enter the SSH username
- Enter the SSH password
- Save the credential
SSH Key Authentication
For key-based authentication:
- Select SSH Key type
- Enter the SSH username
- Paste the entire private key including headers:
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEA...
...
-----END RSA PRIVATE KEY------ Save the credential
Supported key formats:
- RSA (recommended)
- ED25519
- ECDSA
Deleting a Credential
- Find the credential in the list
- Click the Delete button
- Confirm the deletion
Warning: You cannot delete a credential that is in use by hosts. First reassign or delete those hosts.
Security Best Practices
Use SSH Keys Instead of Passwords
SSH keys provide:
- Stronger authentication
- No password transmission over network
- Better audit trail
- Easier rotation
Use Dedicated Service Account
Create a dedicated user for the platform:
# On each managed server
sudo useradd -m -s /bin/bash haas-service
sudo mkdir -p /home/haas-service/.ssh
sudo chmod 700 /home/haas-service/.sshGrant Minimal Required Permissions
The service account needs sudo access for hardening operations:
# /etc/sudoers.d/haas-service
haas-service ALL=(ALL) NOPASSWD: ALLFor scan-only access (no hardening):
haas-service ALL=(ALL) NOPASSWD: /usr/bin/oscapRotate Credentials Regularly
- Generate new SSH key pair
- Add new public key to servers
- Create new credential in the platform
- Update hosts to use new credential
- Remove old public key from servers
- Delete old credential from platform
Protect Private Keys
- Never share private keys
- Use passphrase-protected keys for local storage
- Store keys in secure vault when not in use
- Limit access to credential management
Credential Usage
Assigning to Hosts
When creating or editing a host:
- Select the credential from dropdown
- The host will use this credential for all SSH connections
Checking Credential Works
- Create the credential
- Add a host using the credential
- Click Check on the host
- If successful, the host shows as Online
Generating SSH Key
# Ed25519 (recommended)
ssh-keygen -t ed25519 -C "haas-automation"
# RSA (4096 bits)
ssh-keygen -t rsa -b 4096 -C "haas-automation"Copying Key to Server
ssh-copy-id -i ~/.ssh/id_ed25519.pub user@hostViewing Private Key
cat ~/.ssh/id_ed25519Copy the full output including BEGIN and END lines.
Troubleshooting
Authentication Failed
- Verify username is correct
- For password: check password is correct
- For SSH key: verify the private key matches the public key on server
- Check the user exists on the target server
- Verify SSH is enabled for this user
Permission Denied
- Check the user has shell access
- Verify sudo permissions if running hardening
- Check
/etc/ssh/sshd_configallows this user
Key Format Error
- Ensure full key is pasted including BEGIN/END lines
- Check for extra whitespace or line breaks
- Verify key is in PEM format (not PPK or other formats)
Host Key Verification
The platform automatically accepts host keys on first connection. If a host key changes (server reinstalled), the connection may fail. Contact your administrator to clear the known hosts cache.