Follow the instructions below to enable Kerberos authentication on Red Hat and Ubuntu hosts. For simplicity, these instructions assume:
An account’s local username must match the user’s UMD Directory ID for Kerberos authentication to succeed. If you have users with local accounts that do not match their UMD Directory IDs, their local username will need to be updated or a new local account created that does match their UMD Directory ID.
These instructions are meant as a starting point. You may need to customize these instructions to suit your specific host configuration.
The instructions on this page have been tested with the following Linux distributions:
The instructions may work for other distributions or versions.
If you haven’t already, submit a request to create principals and keytabs by following the instructions in the “Requesting Permission to Create Keytabs” section below.
No Prerequisites
All of the commands to configure Kerberos authentication require elevated privileges. While following the instructions below, assume all commands are prefixed with “sudo” or elevate to the root account before starting e.g. “sudo su -l”.
If you are using a desktop variant of Ubuntu, please install the SSH package on the host before starting: apt install ssh
Follow the instructions below to configure Kerberos authentication.
ssh <DIR_ID>@<FQDN>
Where DIR_ID is your directory ID (or the username for the account you have on the host) and FQDN is the fully-qualified domain name of the host to be updated e.g. linuxrocks.umd.edu.useradd -m -U <DIR_ID>mv /tmp/<FQDN>.keytab /etc/krb5.keytab
chown root:root /etc/krb5.keytab
chmod 400 /etc/krb5.keytabpasswd -l <USER>pam_unix module.A script that implements the steps above as well as two Ansible playbooks are attached to this page (see the attachments banner at the top of the page).
setup_kerb_auth.sh - A bash script to implement Kerberos authentication on Red Hat 8, 9, or 10 or Ubuntu 22.04 or 24.04 hosts. The script will create backup copies of the krb5.conf and sssd.conf files if they already exist. Look for *.bkup.YYYYMMDD files in /etc and /etc/sssd where YYYY is the year, MM is the month, and DD is the day of the month.setup_kerb_auth.redhat.yml - Ansible playbook for Red Hat hosts. Runs the setup_kerb_auth.sh script above with elevated privileges.setup_kerb_auth.ubuntu.yml - Ansible playbook for Ubuntu hosts. Runs the setup_kerb_auth.sh script above with elevated privileges.Please review the instructions in the “Kerberos Authentication on Red Hat and Ubuntu” section above and the script itself before running it. Also, please be sure you’ve created the host principal and uploaded and placed the keytab file on the host as well. Please note that the script does not disable local passwords.
To run the script:
chmod +x setup_kerb_auth.sh./setup_kerb_auth.shThe Ansible playbooks are fairly simple and just run the above setup_kerb_auth.sh script.
To run the playbook:
ansible-playbook -i <HOST>, setup_kerb_auth.ubuntu.yml --ask-become-passansible-playbook -i <HOST>, setup_kerb_auth.redhat.yml --ask-become-passavw-unix-jump2:it-20$ ansible-playbook -i 10.125.28.78, setup_kerb_auth.ubuntu.yml --ask-pass --ask-become-pass
SSH password:
BECOME password[defaults to SSH password]:
PLAY [Enable Kerberos authentication on Ubuntu] ****************************************************
TASK [Gathering Facts] *****************************************************************************
ok: [10.125.28.78]
TASK [run setup_kerb_auth script] ******************************************************************
changed: [10.125.28.78]
PLAY RECAP *****************************************************************************************
10.125.28.78 : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0Not everyone can create Kerberos principals and keytabs. Please email request@umd.edu with your request to create Kerberos principals and keytabs for your department. Please include, if applicable, the subdomain e.g. cs.umd.edu or naming pattern e.g. engr-blahblah.umd.edu you use for your hosts. Please also include any other folks on your team that would need to be able to create or delete principals for your department.
Once your request is approved and implemented, you’re ready to move to the next step!
No matter which distribution you use, you must create a host principal and keytab for each host you’d like to “kerberize”. Follow the instructions below to create a principal and keytab for a host.
ssh <DIR_ID>@glue.umd.edu/usr/glue/scripts/dept_mk_keytab -f ~/<FQDN>.keytab -n host -i <FQDN> -y# On glue.umd.edu:
scp ~/<FQDN>.keytab <FQDN>:/tmp/# On your host:
scp glue.umd.edu:~/<FQDN>.keytab /tmp/rm -f ~/<FQDN>.keytabexitFollow the instructions below to configure Kerberos on your host.
yum install krb5-libs krb5-workstationapt install krb5-user[libdefaults]
default_realm = UMD.EDU
forwardable = true
rdns = false[root@rhel9-test1 cbettenh]# kinit cbettenh@UMD.EDU
Password for cbettenh@UMD.EDU:<DIRECTORY_ID_PASSWORD>
Warning: Your password will expire in 362 days on Tue 24 Mar 2026 09:57:36 AM EDT
[root@rhel9-test1 cbettenh]# klist
Ticket cache: FILE:/tmp/krb5cc_0
Default principal: cbettenh@UMD.EDU
Valid starting Expires Service principal
03/26/2025 22:18:13 03/27/2025 22:18:09 krbtgt/UMD.EDU@UMD.EDUSSSD is the “System Security Services Daemon” and allows hosts to access remote directories and authentication mechanisms. SSSD supports multiple identity and authentication providers, such as:
SSSD in concert with a PAM (Pluggable Authentication Modules) module (pam_sss) allows the identity and authentication providers above to be inserted into the PAM stack.
To configure SSSD on your Linux host, follow the instructions below:
yum install sssd-proxy sssd-krb5apt install sssd-krb5[sssd]
domains = umd.edu
services = pam
config_file_version = 2
[domain/umd.edu]
id_provider = proxy
proxy_lib_name = files
auth_provider = krb5
krb5_realm = UMD.EDU
krb5_use_kdcinfo = falsecache_credentials = true[pam]
# Allow credentials to be cached for 1 day
offline_credentials_expiration = 1chown root:root /etc/sssd/sssd.conf
chmod 600 /etc/sssd/sssd.confauthselect select sssd --forcesystemctl enable sssd --nowIn most cases, Kerberos authentication is not supported by the default SSH configuration. Follow the instructions below to allow SSH to support Kerberos authentication:
# GSSAPI options
GSSAPIAuthentication yes
GSSAPICleanupCredentials yessystemctl restart sshdsystemctl restart ssh