TL;DR
This guide explains how to securely authenticate support engineers accessing client systems using SSH keys and a central key management system. This replaces password-based authentication for better security.
1. Understand the Problem
Allowing support engineers direct access to client servers is necessary, but passwords are vulnerable. SSH keys provide a much stronger method of authentication. We’ll set up a system where:
- Support engineers have unique SSH key pairs.
- Public keys are stored centrally (e.g., on a jump server).
- Access is granted based on the engineer’s identity, not just a password.
2. Generate SSH Key Pairs
Each support engineer needs their own key pair. They should do this on their workstation.
- Open a terminal or command prompt.
- Run the following command to generate a new key pair (replace
engineer@example.comwith their email address):
ssh-keygen -t rsa -b 4096 -C "engineer@example.com"
id_rsa (the private key – keep this secret!) and id_rsa.pub (the public key).3. Central Key Management
We’ll use a jump server to manage the authorized keys.
- Choose a Jump Server: Select a secure server that support engineers can access, but isn’t directly exposed to the internet.
- Create an
authorized_keysfile: On the jump server, create a directory (e.g.,/home/support/.ssh) and an empty file namedauthorized_keyswithin it. Ensure appropriate permissions are set:
mkdir /home/support/.ssh && chmod 700 /home/support/.ssh && touch /home/support/.ssh/authorized_keys && chmod 600 /home/support/.ssh/authorized_keys
id_rsa.pub) to the authorized_keys file on the jump server. Each key should be on a new line.4. Configure Client Servers
Modify each client server to allow SSH access only from the jump server.
- Edit
sshd_config: Open the SSH daemon configuration file (usually located at/etc/ssh/sshd_config) on each client server. - Restrict Access: Add or modify these lines to restrict access:
AllowUsers support@jump-server-ip
(Replace support@jump-server-ip with the appropriate username and IP address of your jump server.)
PasswordAuthentication noChallengeResponseAuthentication no
sudo systemctl restart sshd
5. Accessing Client Servers
Support engineers connect through the jump server.
- Connect via Jump Server: Engineers SSH into the jump server first:
ssh support@jump-server-ip
6. Using an SSH Agent
To avoid repeatedly entering the passphrase, use an SSH agent.
- Start the Agent: Start the SSH agent on the engineer’s workstation:
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa