Last active
December 25, 2022 11:49
-
-
Save eladc/d3c49effea823a4c2f00ca243006ec5a to your computer and use it in GitHub Desktop.
[Linux] Create a keytab file for kerberos authentication
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Variables | |
UHOME=/home/$(logname) | |
GID=$(id -g $(basename $UHOME)) | |
USRID=$(id -u $(basename $UHOME)) | |
DOMAIN=YOUR-DOMAIN.ORG | |
## create keytab | |
function create_tkt { | |
ktutil > /dev/null <<INTER | |
add_entry -password -p $AUSER@$DOMAIN -k 0 -e aes256-sha1 | |
$PASSWD | |
wkt $UHOME/.$AUSER.keytab | |
quit | |
INTER | |
chmod 600 $UHOME/.$AUSER.keytab | |
chown $USRID:$GID $UHOME/.$AUSER.keytab | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment