SSH can authenticate users with Kerberos tickets. GSSAPIAuthentication controls whether an OpenSSH server accepts Kerberos-based authentication when the required ticket infrastructure exists.
The upstream default is no, although a distribution or local configuration can override it. Setting GSSAPIAuthentication yes allows ticket authentication; it does not create a Kerberos realm, obtain a client ticket, or provision the server's host service principal and keytab. The client must also enable GSSAPI authentication.
Disabling GSSAPI removes ticket-based logins and can lock out users who depend on them. Keep an authenticated administrative session or console available until a fresh login succeeds. The service reload requires systemd on Linux, and the Kerberos infrastructure must already work before testing the enabled path.
For a diagnosed delay involving unnecessary GSSAPI attempts, see How to speed up SSH authentication. Client-side configuration is covered in How to show SSH client configuration.
Steps to enable or disable GSSAPI authentication on an SSH server:
- Keep a second administrative SSH session or console open before editing authentication policy.
- Check the effective GSSAPIAuthentication value on the server.
$ sudo sshd -T | grep '^gssapiauthentication ' gssapiauthentication no
sshd -T reads configuration from disk, including defaults and included files; it does not query the running daemon. For a connection affected by Match blocks, use sudo sshd -T -C user=user,addr=203.0.113.10 with the actual login name and client address, plus other connection fields used by the policy. The configuration checks assume the service uses the default configuration; custom -f or -o service arguments must also be reflected in the checks.
Related: How to view SSH server configuration - Locate saved GSSAPI settings and their Include or Match boundaries.
$ sudo grep -RniE '^[[:space:]]*(Include|Match|GSSAPIAuthentication)[[:space:]]' /etc/ssh/sshd_config /etc/ssh/sshd_config.d /etc/ssh/sshd_config:24:Include /etc/ssh/sshd_config.d/*.conf /etc/ssh/sshd_config.d/90-gssapi.conf:1:GSSAPIAuthentication no
The search covers the usual main file and drop-in directory. If Include names another location, inspect that file too; if the drop-in directory does not exist, search only the main file. Keywords are case-insensitive, and the first obtained value normally wins, so a later drop-in may not override an earlier setting. No matching GSSAPI line here does not prove the built-in default is active.
- Open the file that supplies the active server setting.
$ sudoedit /etc/ssh/sshd_config.d/90-gssapi.conf
Edit the existing effective directive when one is present. If none exists, create this drop-in only when the main file includes it in the global section; otherwise use /etc/ssh/sshd_config. A Match-specific policy belongs in its matching block.
- Set GSSAPIAuthentication to no to disable GSSAPI authentication or yes to enable it.
GSSAPIAuthentication no
Enabling GSSAPI requires an existing Kerberos setup. If the directive is absent, add it in the global section before any Match block for a server-wide policy. Other authentication methods keep their separate settings.
- Save the configuration file.
- Test the SSH daemon configuration.
$ sudo sshd -t
No output and a successful exit mean the syntax and host-key checks passed. If the test fails, correct the file before reloading.
Related: How to test SSH server configuration - Reload the SSH service to apply the setting.
$ sudo systemctl reload ssh
Use sudo systemctl reload sshd on systems where the unit is named sshd. If reload is unsupported, a restart can interrupt access; restart only after the syntax test passes and while the fallback session or console remains available.
Related: How to manage the SSH server service with systemctl - Verify the effective value after the reload.
$ sudo sshd -T | grep '^gssapiauthentication ' gssapiauthentication no
The result must match the intended no or yes. For Match policies, repeat the connection-specific check. A fresh connection is still needed to test the running service.
- Verify a fresh password or key login from a client when GSSAPI is disabled.
$ ssh -o ControlPath=none -o GSSAPIAuthentication=no user@host.example.net 'id -un' user
user and host.example.net represent your login account and server. ControlPath=none prevents reuse of an existing authenticated connection. This confirms fallback access; the preceding server check must show gssapiauthentication no. If the new login fails, keep the fallback session open while restoring the previous setting and repeating the syntax test and reload.
Related: How to log in to an SSH server from Linux - Check the client's Kerberos ticket cache when enabling GSSAPI.
$ klist Ticket cache: FILE:/tmp/krb5cc_1001 Default principal: user@GUIDE.TEST Valid starting Expires Service principal 11/05/26 07:50:11 11/06/26 07:50:11 krbtgt/GUIDE.TEST@GUIDE.TEST
The client needs an unexpired ticket for the intended principal. The realm and dates depend on your environment. If no valid ticket exists, obtain one through your organisation's Kerberos login process before the next test.
- Verify a fresh GSSAPI-only login from the Kerberos-configured client when GSSAPI is enabled.
$ ssh -v -o ControlPath=none -o GSSAPIAuthentication=yes -o PreferredAuthentications=gssapi-with-mic user@host.example.net 'id -un' ##### snipped ##### Authenticated to host.example.net ([192.0.2.20]:22) using "gssapi-with-mic". ##### snipped ##### user ##### snipped #####
The line containing using "gssapi-with-mic" proves GSSAPI was selected; the username comes from the remote command. PreferredAuthentications limits the test to gssapi-with-mic, preventing password or key fallback. ControlPath=none forces a new connection. A failure means ticket authentication has not been proved, even if an ordinary SSH login works. Servers requiring an additional authentication factor may reject this single-method test.