Created
January 7, 2017 18:00
-
-
Save vijayjt/579c8b2d0bcf320e82cfd9f528c95ec5 to your computer and use it in GitHub Desktop.
Easiest way to kinit as hdfs, hive or another Hadoop system user with CDH
This file contains 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
export HDPUSER='hive' | |
export DOMAIN=$(dnsdomainname) | |
export PKEYTAB=$(ls -Rt /var/run/cloudera-scm-agent/process/*/*keytab | grep $HDPUSER | head -1) | |
export PRINC=$(klist -kt $PKEYTAB | grep -v FILE | grep $HDPUSER | awk '{print $4}') | |
kinit -V -kt $PKEYTAB $PRINC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment