-
Notifications
You must be signed in to change notification settings - Fork 3
Guide SSH server administration
Palo Alto Networks SSH Manager · vSSH CLI
This guide is for the people who run the hosts users log in to. It covers making an OpenSSH server trust certificates from SSH Manager, mapping certificate identities to local accounts, and letting clients trust host certificates.
Four pieces make certificate-based SSH work on a host:
-
TrustedUserCAKeysinsshd_configpoints to a file of CA public keys. sshd accepts any user certificate signed by one of those keys. -
AuthorizedPrincipalsdecides which certificate principals may log in as which local user. - Host certificates (optional) let clients verify the host without a trust-on-first-use prompt.
-
@cert-authoritylines in a client'sknown_hoststell the client which CA signs host certificates.
You configure the first two on the server. The last two are for host-key trust, covered at the end.
Start by seeing what the host trusts now.
sudo vssh openssh server showIt prints the config file and owner, the TrustedUserCAKeys file and the fingerprints of the CA keys in it, the AuthorizedPrincipals settings, and host keys and certificates. Run it before and after any change to confirm the result. See openssh.
Retrieve the CA key and place it yourself. This works on any platform.
vssh service ca retrieve \
--use-to-configure openssh_server \
--out-file /etc/ssh/trusted_user_ca_keys \
--template "Users - Web Admins"Then add the line to sshd_config and reload:
TrustedUserCAKeys /etc/ssh/trusted_user_ca_keys
sudo sshd -t && sudo systemctl reload sshdsshd -t checks the config before you reload, so a typo does not lock you out. Details are in Configure OpenSSH server for client authentication.
A certificate lists one or more principals (usernames it is valid for). AuthorizedPrincipals controls which of those may become which local account. Use it to keep certificate identities separate from local usernames.
Example: allow anyone whose certificate carries the web-admins principal to log in as the local deploy user. In sshd_config:
AuthorizedPrincipalsFile /etc/ssh/auth_principals/%u
Then create /etc/ssh/auth_principals/deploy containing:
web-admins
Now a user presenting a valid certificate with the web-admins principal can log in as deploy, and nothing else grants that access. Reload sshd after the change.
The steps above let a host verify users. You can also let users verify the host, which removes the "authenticity of host cannot be established" prompt and protects against a spoofed server.
Produce a known_hosts entry that trusts host certificates from the CA:
vssh service ca retrieve \
--use-to-configure openssh_client \
--out-file ~/.ssh/known_hostsThis writes a line beginning with @cert-authority *. Distribute it to clients (or add it to the system-wide /etc/ssh/ssh_known_hosts) so any host presenting a valid host certificate is trusted without a prompt.
- Inspect the host first with
vssh openssh server show. - Configure trust with
service ca retrieveand asshd_configedit. - Validate with
sshd -tbefore every reload. - Restrict logins with
AuthorizedPrincipalsrather than trusting every principal. - Distribute an
@cert-authorityentry so clients trust host certificates. - Confirm the result with
vssh openssh server show.
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