Skip to content

Instantly share code, notes, and snippets.

@alces
Created January 7, 2020 12:36
Show Gist options
  • Save alces/1e430a7099f79b965b973ee45688835c to your computer and use it in GitHub Desktop.
Save alces/1e430a7099f79b965b973ee45688835c to your computer and use it in GitHub Desktop.
Check all Kerberos keytabs in the current directory
#!/bin/bash
# Check all keytabs in the current directory
for kt in *.keytab
do
pr=$(klist -k $kt | tail -1 | awk '{print $2}')
echo -n "${kt}: "
kinit -kt $kt $pr > /dev/null 2>&1 && echo OK || echo FAILED
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment