Using certificates for SSH authentication
Using certificates for SSH authentication
Posted Nov 9, 2022 12:46 UTC (Wed) by cortana (subscriber, #24596)Parent article: Using certificates for SSH authentication
With Kerberos (as configured by FreeIPA, with which I'm most familiar) we have:
* Initial authentication on a user workstation with password, password + OTP or smart card
* Initial authentication can also be linked to an external OpenID Connect identity provider (although you can't yet use this from the GDM login screen, it's more usable when with kinit or SSH with keyboard-interactive authentication, in which case the user can click the URL in their terminal, log in to the IdP in their browser, and then hit enter to receive their TGT & finish logging in
* With a short TGT expiry time & longer renewable lifetime, sssd (running on user workstation) can automatically renew TGTs when they expire - this gives you the ability to lock users out in the middle of the day (say, if the new CEO capriciously decides to fire half the workforce...)
* Kerberos works with lots of other stuff than just SSH so you get SSO for all sorts of protocols (HTTP, NFS, SMB, LDAP, IMAP, SMTP, at home I even use Kerberos to authenticate virsh on my workstation to libvirtd running on servers)
* The amazing pam_sss_gss module can be used in service's auth stacks; for instance, to implement passwordless sudo
* Pretty good integration with Windows which is important for acceptance in enterprises where IdM is likely to be built around Active Directory
Disadvantages:
* Kerberos itself doesn't provide perfect forward security, so if your session keys are stolen they can be used to decrypt network traffic later on
* The GSSAPI path for OpenSSH is not approved by upstream. I don't know all the details of why but I think part of it is that the Kerberos authentication runs as the part of sshd that still runs as root. But it's patched in by Debian and Red Hat & so for most people this isn't a huge concern as long as they install security updates
* It initially seems complex & mysterious to maintain, which is why I rely on FreeIPA to do it for me. Is it harder than running a CA properly, probably not...
* Fragmentation in the Kerberos ecosystem means that you can run into annoying compatibility issues (e.g., on Debian, Samba is built against Heimdal Kerberos, which can't use KEYRING/KCM credentials caches; anything running on the JVM is generally a nightmare to configure, can't use the system-wide credentials cache, can't obtain a TGT using modern authentication so you're stuck with password authentication for obtaining the TGT & imposes obsolete crypto)
