From 24260f8af5579822a776a12165166b6c6dcddda1 Mon Sep 17 00:00:00 2001 From: zeekling Date: Sat, 16 Jul 2022 14:16:51 +0800 Subject: [PATCH] add kerberos docker --- kerberos/start.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/kerberos/start.sh b/kerberos/start.sh index 4d9374e..64d715f 100755 --- a/kerberos/start.sh +++ b/kerberos/start.sh @@ -15,6 +15,8 @@ inited="/app/inited" function init_user() { if [ -f "${inited}" ];then echo "user inited" + kadmin.local -q "xst -k /app/hadoop.keytab -norandkey server/hadoop.${FQDN}" + kadmin.local -q "xst -k /app/cli.keytab -norandkey cli" return; fi echo "begin init user" @@ -23,11 +25,12 @@ function init_user() { # create admin echo -e "${PASS}\n${PASS}" | kadmin.local -q "addprinc ${ADMIN}/admin" # create hadoop - echo -e "${PASS}\n${PASS}" | kadmin.local -q "addprinc hadoop" - echo -e "${PASS}\n${PASS}" | kadmin.local -q "addprinc hadoop/${FQDN}" - kadmin.local -q "ktadd -norandkey -k ${KRB5_KTNAME} hadoop" - kadmin.local -q "ktadd -norandkey -k ${KRB5_KTNAME} hadoop/${FQDN}" - kadmin.local -q "xst -k /app/hadoop.keytab -norandkey hadoop/${FQDN}" + echo -e "${PASS}\n${PASS}" | kadmin.local -q "addprinc cli" + echo -e "${PASS}\n${PASS}" | kadmin.local -q "addprinc server/hadoop.${FQDN}" + kadmin.local -q "ktadd -norandkey -k ${KRB5_KTNAME} cli" + kadmin.local -q "ktadd -norandkey -k ${KRB5_KTNAME} server/hadoop.${FQDN}" + kadmin.local -q "xst -k /app/hadoop.keytab -norandkey server/hadoop.${FQDN}" + kadmin.local -q "xst -k /app/cli.keytab -norandkey cli" touch "${inited}" echo "user inite success" }