Repository navigation
Configure OpenSSH server for client authentication
Palo Alto Networks SSH Manager · vSSH CLI
This document describes how to configure OpenSSH server to allow client authentication using SSH client certificates by trusting the SSH certificate authority (CA). vSSH CLI requests SSH certificates from Palo Alto Networks SSH Manager.
Note: For the broader picture, including principal mapping and host-key trust, see SSH server administration.
To perform the tasks described in this document, you'll need:
- Access to SSH Manager version 23.1 or later.
- vSSH CLI utility. You can download it from here
- Completed the prerequisites to use vSSH CLI with SSH Manager document.
We are going to configure a Linux host to trust the SSH CA of SSH Manager.
- Open terminal and connect to the Linux host that you want to configure.
- Make sure that you have the vSSH CLI installed. If you don't have it, you can follow the instructions to install it.
- Retrieve the public key of your SSH CA and store it to a file (e.g.,
/etc/ssh/trusted_user_ca_keys). Usevssh service ca retrievecommand.
user@linux:~$ vssh service ca retrieve
Logging in as alice...
? Enter password for user alice: [? for help] ************
Authenticating...
? Select the templates that you want to use: Users - Web Admins
? How are you going to use the retrieved CA keys: I will use them to configure OpenSSH server to allow client access
? Do you want to save the CA keys to the file system? Yes, save them to a file
? Enter file name: /etc/ssh/trusted_user_ca_keys
Saving CA public keys to /etc/ssh/trusted_user_ca_keyNote: To automate the process of retrieving the CA public key, you can use
vsshin noninteractive mode. Just pass all the necessary information using flags. Example:vssh service ca retrieve --no-prompt --template "Users - Web Admins" --use-to-configure openssh_server --out-file trusted_user_ca_keys.pub
- Open
/etc/ssh/sshd_configand add the following lines to the end of the file.
TrustedUserCAKeys /etc/ssh/trusted_user_ca_keys
- TrustUserCAKeys: The public key of the SSH certificate authority used to verify SSH client certificates.
- Test the OpenSSH server configuration by running the following command:
user@linux:~$ /usr/local/sbin/sshd -t -f /etc/ssh/sshd_config
user@linux:~$ echo $?
0- /usr/local/sbin/sshd: The path to the OpenSSH server. You may need to change it if OpenSSH server is installed on a different location.
- Restart OpenSSH server.
user@linux:~$ sudo systemctl restart sshdYou can test the configuration by connecting to the Linux host from another host (e.g., your workstation).
- Enroll an SSH certificate for interactive logins using
vssh logincommand.
user@workstation:~$ vssh login
Logging in as alice...
? Enter password for user alice: [? for help] ************
Authenticating...
Logged in as alice
One template (Users - Web Admins) found. Using it.
Your identity is alice
Your role is Users - Web Admins (expires in 12 hours)
Credentials have been added to your OpenSSH agent.
Now you can perform SSH logins to remote servers.- Open an interactive SSH session to a remote host.
user@workstation:~$ ssh alice@web.example.com
Linux web.example.com 5.10.0-10-amd64
You have new mail.
Last login: Tue May 17 13:20:12 2022 from 172.17.254.151
alice@web:~$ Palo Alto Networks SSH Manager · vSSH CLI. Licensed under the Apache License, Version 2.0. To report a problem or share an idea, use Issues.
Getting started
Configuration
Authentication
Guides
Tutorials
- Interactive user access
- Machine identity for apps and hosts
- CI/CD pipeline enrollment
- Enroll for interactive logins
- Enroll for an application or host
- Renew a certificate
- Retrieve SSH CA public keys
Command reference
- Overview and global options
- login
- logout
- certificate
- profile
- service
- openssh
- status
- update
- version
- help
Reference