<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Enabling Keberos for cluster fails when importing KDC account manager in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Enabling-Keberos-for-cluster-fails-when-importing-KDC/m-p/65990#M48258</link>
    <description>&lt;P&gt;Any solution pls..&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 03 Apr 2018 07:43:46 GMT</pubDate>
    <dc:creator>sandy05</dc:creator>
    <dc:date>2018-04-03T07:43:46Z</dc:date>
    <item>
      <title>Enabling Keberos for cluster fails when importing KDC account manager</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Enabling-Keberos-for-cluster-fails-when-importing-KDC/m-p/65736#M48250</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to enable kerberos for my cloudera cluster. I have setup the keberos configuration file on the server and added principal for cloudera-scm but when importing the account manager credentials, I am getting following error. I tried to find solutions from already posted solutions, but all looks fine and still getting error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are my configurations and versions of Cloudera&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CDH 5.12.2&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Java Version&lt;/STRONG&gt;&lt;SPAN&gt;: 1.7.0_75&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;priclusedge.a.15192.internal&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; cat /etc/krb5.conf


[logging]
 default = FILE:/var/log/krb5libs.log
 kdc = FILE:/var/log/krb5kdc.log
 admin_server = FILE:/var/log/kadmind.log

[libdefaults]
 default_realm = PRICLUSTER.COM
 dns_lookup_realm = false
 dns_lookup_kdc = false
 ticket_lifetime = 24h
 renew_lifetime = 7d
 forwardable = true
 udp_preference_limit = 1000000
 default_tkt_enctypes = des-cbc-md5 des-cbc-crc des3-cbc-sha1
 default_tgs_enctypes = des-cbc-md5 des-cbc-crc des3-cbc-sha1
 permitted_enctypes = des-cbc-md5 des-cbc-crc des3-cbc-sha1

[realms]
 PRICLUSTER.COM = {
  kdc = priclusedge.a.15192.internal:88
  admin_server = priclusedge.a.15192.internal:749
  default_domain = pricluster.com
 }

[domain_realm]
  .pricluster.com = PRICLUSTER.COM
  pricluster.com = PRICLUSTER.COM

&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; cat kdc.conf



[kdcdefaults]
 kdc_ports = 88
 kdc_tcp_ports = 88
 v4_mode = nopreauth

[realms]
 PRICLUSTER.COM = {
  #master_key_type = aes256-cts
  acl_file = /var/kerberos/krb5kdc/kadm5.acl
  key_stash_file = /var/kerberos/krb5kdc/stash
  dict_file = /usr/share/dict/words
  admin_keytab = /var/kerberos/krb5kdc/kadm5.keytab
  database_name = /var/kerberos/krb5kdc/principal
  max_life = 1d
  max_renewable_life = 7d
  master_key_type = des3-hmac-sha1
  default_principal_flags = +preauth
  supported_enctypes = aes256-cts:normal aes128-cts:normal des3-hmac-sha1:normal des-hmac-sha1:normal des-cbc-crc:normal
 }

default_realm = PRICLUSTER.COM&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;[root@priclusedge krb5kdc]# kadmin.local

Authenticating as principal root/admin@PRICLUSTER.COM with password.
kadmin.local:  get_principals
K/M@PRICLUSTER.COM
cloudera-scm/admin@PRICLUSTER.COM
kadmin/admin@PRICLUSTER.COM
kadmin/changepw@PRICLUSTER.COM
kadmin/&lt;SPAN&gt;priclusedge.a.15192.internal&lt;/SPAN&gt;@PRICLUSTER.COM
krbtgt/PRICLUSTER.COM@PRICLUSTER.COM&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;[root@priclusedge krb5kdc]# service krb5kdc status
krb5kdc (pid  6096) is running...
[root@priclusedge krb5kdc]# service kadmin status
kadmind (pid  6129) is running...&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error Message while importing accout manager credentials&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;/usr/share/cmf/bin/import_credentials.sh failed with exit code 1 and output of &amp;lt;&amp;lt;
+ export PATH=/usr/kerberos/bin:/usr/kerberos/sbin:/usr/lib/mit/sbin:/usr/sbin:/usr/lib/mit/bin:/usr/bin:/sbin:/usr/sbin:/bin:/usr/bin
+ PATH=/usr/kerberos/bin:/usr/kerberos/sbin:/usr/lib/mit/sbin:/usr/sbin:/usr/lib/mit/bin:/usr/bin:/sbin:/usr/sbin:/bin:/usr/bin
+ KEYTAB_OUT=/var/run/cloudera-scm-server/cmf8091152271730902012.keytab
+ USER=cloudera-scm/REDACTED@PRICLUSTER.COM
+ PASSWD=REDACTED
+ KVNO=1
+ SLEEP=0
+ RHEL_FILE=/etc/redhat-release
+ '[' -f /etc/redhat-release ']'
+ set +e
+ grep Tikanga /etc/redhat-release
+ '[' 1 -eq 0 ']'
+ '[' 0 -eq 0 ']'
+ grep 'CentOS release 5' /etc/redhat-release
+ '[' 1 -eq 0 ']'
+ '[' 0 -eq 0 ']'
+ grep 'Scientific Linux release 5' /etc/redhat-release
+ '[' 1 -eq 0 ']'
+ set -e
+ '[' -z /etc/krb5.conf ']'
+ echo 'Using custom config path '\''/etc/krb5.conf'\'', contents below:'
+ cat /etc/krb5.conf
+ IFS=' '
+ read -a ENC_ARR
+ ktutil
+ for ENC in '"${ENC_ARR[@]}"'
+ echo 'addent -password -p cloudera-scm/REDACTED@PRICLUSTER.COM -k 1 -e aes256-cts:normal'
+ '[' 0 -eq 1 ']'
+ echo REDACTED
+ for ENC in '"${ENC_ARR[@]}"'
+ echo 'addent -password -p cloudera-scm/REDACTED@PRICLUSTER.COM -k 1 -e aes128-cts:normal'
+ '[' 0 -eq 1 ']'
+ echo REDACTED
+ for ENC in '"${ENC_ARR[@]}"'
+ echo 'addent -password -p cloudera-scm/REDACTED@PRICLUSTER.COM -k 1 -e des3-hmac-sha1:normal'
+ '[' 0 -eq 1 ']'
+ echo REDACTED
+ for ENC in '"${ENC_ARR[@]}"'
+ echo 'addent -password -p cloudera-scm/REDACTED@PRICLUSTER.COM -k 1 -e des-hmac-sha1:normal'
+ '[' 0 -eq 1 ']'
+ echo REDACTED
+ for ENC in '"${ENC_ARR[@]}"'
+ echo 'addent -password -p cloudera-scm/REDACTED@PRICLUSTER.COM -k 1 -e des-cbc-crc:normal'
+ '[' 0 -eq 1 ']'
+ echo REDACTED
+ echo 'wkt /var/run/cloudera-scm-server/cmf8091152271730902012.keytab'
addent: Bad encryption type while adding new entry
ktutil: Unknown request "REDACTED".  Type "?" for a request list.
addent: Bad encryption type while adding new entry
ktutil: Unknown request "REDACTED".  Type "?" for a request list.
addent: Bad encryption type while adding new entry
ktutil: Unknown request "REDACTED".  Type "?" for a request list.
addent: Bad encryption type while adding new entry
ktutil: Unknown request "REDACTED".  Type "?" for a request list.
addent: Bad encryption type while adding new entry
ktutil: Unknown request "REDACTED".  Type "?" for a request list.
+ chmod 600 /var/run/cloudera-scm-server/cmf8091152271730902012.keytab
chmod: cannot access `/var/run/cloudera-scm-server/cmf8091152271730902012.keytab': No such file or directory

&amp;gt;&amp;gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 25 Mar 2018 13:20:39 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Enabling-Keberos-for-cluster-fails-when-importing-KDC/m-p/65736#M48250</guid>
      <dc:creator>sandy05</dc:creator>
      <dc:date>2018-03-25T13:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: Enabling Keberos for cluster fails when importing KDC account manager</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Enabling-Keberos-for-cluster-fails-when-importing-KDC/m-p/65820#M48251</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;anybody has any idea.. ?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Mar 2018 15:51:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Enabling-Keberos-for-cluster-fails-when-importing-KDC/m-p/65820#M48251</guid>
      <dc:creator>sandy05</dc:creator>
      <dc:date>2018-03-27T15:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: Enabling Keberos for cluster fails when importing KDC account manager</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Enabling-Keberos-for-cluster-fails-when-importing-KDC/m-p/65822#M48252</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/23079"&gt;@sandy05&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is a tricky one, but, in the past, this sort of issue was resolved by adding a 1 second sleep to the import script.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Back up the following file:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;/usr/share/cmf/bin/import_credentials.sh&lt;/STRONG&gt; file on your Cloudera Manager host.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(2)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit &lt;STRONG&gt;/usr/share/cmf/bin/import_credentials.sh&lt;/STRONG&gt; on your Cloudera Manager host&lt;/P&gt;&lt;P&gt;Locate this text near the top of the file:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Determine if sleep is needed before echoing password.&lt;BR /&gt;# This is needed on Centos/RHEL 5 where ktutil doesn't&lt;BR /&gt;# accept password from stdin.&lt;BR /&gt;SLEEP=0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(3)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Change:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SLEEP=0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SLEEP=1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(4)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try using Cloudera Manager to import credentials again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have observed from time to time that timing in the "addent" commands in the script will lead to this sort of issue.&amp;nbsp; Adding some sleep has resovled it in the past.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ben&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Mar 2018 17:32:15 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Enabling-Keberos-for-cluster-fails-when-importing-KDC/m-p/65822#M48252</guid>
      <dc:creator>bgooley</dc:creator>
      <dc:date>2018-03-27T17:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: Enabling Keberos for cluster fails when importing KDC account manager</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Enabling-Keberos-for-cluster-fails-when-importing-KDC/m-p/65824#M48253</link>
      <description>Thanks.&lt;BR /&gt;I tried sleep=1 in the past and it didn't work. But let me try again. 'll&lt;BR /&gt;keep u updated.&lt;BR /&gt;</description>
      <pubDate>Tue, 27 Mar 2018 19:14:49 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Enabling-Keberos-for-cluster-fails-when-importing-KDC/m-p/65824#M48253</guid>
      <dc:creator>sandy05</dc:creator>
      <dc:date>2018-03-27T19:14:49Z</dc:date>
    </item>
    <item>
      <title>Re: Enabling Keberos for cluster fails when importing KDC account manager</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Enabling-Keberos-for-cluster-fails-when-importing-KDC/m-p/65825#M48254</link>
      <description>But even for centos or rhel6 needed it ?</description>
      <pubDate>Tue, 27 Mar 2018 19:15:47 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Enabling-Keberos-for-cluster-fails-when-importing-KDC/m-p/65825#M48254</guid>
      <dc:creator>sandy05</dc:creator>
      <dc:date>2018-03-27T19:15:47Z</dc:date>
    </item>
    <item>
      <title>Re: Enabling Keberos for cluster fails when importing KDC account manager</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Enabling-Keberos-for-cluster-fails-when-importing-KDC/m-p/65831#M48255</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/23079"&gt;@sandy05&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;No, not usually and that is why we didn't code to add sleep there.&amp;nbsp; To be honest, I don't know the history of the need for the "sleep" in some OSes and not others.&amp;nbsp; Indeed, it has not been needed for el6 as far as I know.&lt;/P&gt;&lt;P&gt;Based on your report of the issue, though, the situation usually ends up being resolved (in Cloudera internal cases) by inserting a sleep of 1 second.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If that doesn't help, let us know and share with us the edited file so we can verify the change.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ben&lt;/P&gt;</description>
      <pubDate>Tue, 27 Mar 2018 23:25:11 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Enabling-Keberos-for-cluster-fails-when-importing-KDC/m-p/65831#M48255</guid>
      <dc:creator>bgooley</dc:creator>
      <dc:date>2018-03-27T23:25:11Z</dc:date>
    </item>
    <item>
      <title>Re: Enabling Keberos for cluster fails when importing KDC account manager</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Enabling-Keberos-for-cluster-fails-when-importing-KDC/m-p/65866#M48256</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/4054"&gt;@bgooley&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot for reverting back to my queries .&amp;nbsp; &amp;nbsp;I tried with the solution you said by changing sleep=0 to sleep=1 but still&amp;nbsp; get the same error message .&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;/usr/share/cmf/bin/import_credentials.sh failed with exit code 1 and output of &amp;lt;&amp;lt;
+ export PATH=/usr/kerberos/bin:/usr/kerberos/sbin:/usr/lib/mit/sbin:/usr/sbin:/usr/lib/mit/bin:/usr/bin:/sbin:/usr/sbin:/bin:/usr/bin
+ PATH=/usr/kerberos/bin:/usr/kerberos/sbin:/usr/lib/mit/sbin:/usr/sbin:/usr/lib/mit/bin:/usr/bin:/sbin:/usr/sbin:/bin:/usr/bin
+ KEYTAB_OUT=/var/run/cloudera-scm-server/cmf4656589489540061286.keytab
+ USER=cloudera-scm/REDACTED@PRICLUSTER.COM
+ PASSWD=REDACTED
+ KVNO=1
+ SLEEP=1
+ RHEL_FILE=/etc/redhat-release
+ '[' -f /etc/redhat-release ']'
+ set +e
+ grep Tikanga /etc/redhat-release
+ '[' 1 -eq 0 ']'
+ '[' 1 -eq 0 ']'
+ '[' 1 -eq 0 ']'
+ set -e
+ '[' -z /etc/krb5.conf ']'
+ echo 'Using custom config path '\''/etc/krb5.conf'\'', contents below:'
+ cat /etc/krb5.conf
+ IFS=' '
+ read -a ENC_ARR
+ for ENC in '"${ENC_ARR[@]}"'
+ echo 'addent -password -p cloudera-scm/REDACTED@PRICLUSTER.COM -k 1 -e aes256-cts:normal'
+ '[' 1 -eq 1 ']'
+ sleep 1
+ ktutil
addent: Bad encryption type while adding new entry
+ echo REDACTED
+ for ENC in '"${ENC_ARR[@]}"'
+ echo 'addent -password -p cloudera-scm/REDACTED@PRICLUSTER.COM -k 1 -e aes128-cts:normal'
+ '[' 1 -eq 1 ']'
+ sleep 1
ktutil: Unknown request "REDACTED".  Type "?" for a request list.
addent: Bad encryption type while adding new entry
+ echo REDACTED
+ for ENC in '"${ENC_ARR[@]}"'
+ echo 'addent -password -p cloudera-scm/REDACTED@PRICLUSTER.COM -k 1 -e des3-hmac-sha1:normal'
+ '[' 1 -eq 1 ']'
+ sleep 1
ktutil: Unknown request "REDACTED".  Type "?" for a request list.
addent: Bad encryption type while adding new entry
+ echo REDACTED
+ for ENC in '"${ENC_ARR[@]}"'
+ echo 'addent -password -p cloudera-scm/REDACTED@PRICLUSTER.COM -k 1 -e des-hmac-sha1:normal'
+ '[' 1 -eq 1 ']'
+ sleep 1
ktutil: Unknown request "REDACTED".  Type "?" for a request list.
addent: Bad encryption type while adding new entry
+ echo REDACTED
+ for ENC in '"${ENC_ARR[@]}"'
+ echo 'addent -password -p cloudera-scm/REDACTED@PRICLUSTER.COM -k 1 -e des-cbc-crc:normal'
+ '[' 1 -eq 1 ']'
+ sleep 1
ktutil: Unknown request "REDACTED".  Type "?" for a request list.
addent: Bad encryption type while adding new entry
+ echo REDACTED
+ echo 'wkt /var/run/cloudera-scm-server/cmf4656589489540061286.keytab'
ktutil: Unknown request "REDACTED".  Type "?" for a request list.
+ chmod 600 /var/run/cloudera-scm-server/cmf4656589489540061286.keytab
chmod: cannot access `/var/run/cloudera-scm-server/cmf4656589489540061286.keytab': No such file or directory&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have also shared the modified&amp;nbsp;import_credentials.sh.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;cat /etc/redhat-release&lt;BR /&gt;CentOS release 6.9 (Final)&lt;/P&gt;&lt;PRE&gt;#!/usr/bin/env bash

# Copyright (c) 2014 Cloudera, Inc. All rights reserved.

set -e
set -x

# Explicitly add RHEL5/6 and SLES11/12 locations to path
export PATH=/usr/kerberos/bin:/usr/kerberos/sbin:/usr/lib/mit/sbin:/usr/sbin:/usr/lib/mit/bin:/usr/bin:$PATH

KEYTAB_OUT=$1
USER=$2
PASSWD=$3
KVNO=$4

# Determine if sleep is needed before echoing password.
# This is needed on Centos/RHEL 5 where ktutil doesn't
# accept password from stdin.
SLEEP=1
RHEL_FILE=/etc/redhat-release
if [ -f $RHEL_FILE ]; then
  set +e # Ignore errors in grep
  grep Tikanga $RHEL_FILE
  if [ $? -eq 0 ]; then
    SLEEP=1
  fi
  if [ $SLEEP -eq 0 ]; then
    grep 'CentOS release 5' $RHEL_FILE
    if [ $? -eq 0 ]; then
      SLEEP=1
    fi
  fi
  if [ $SLEEP -eq 0 ]; then
    grep 'Scientific Linux release 5' $RHEL_FILE
    if [ $? -eq 0 ]; then
      SLEEP=1
    fi
  fi
  set -e
fi

if [ -z "$KRB5_CONFIG" ]; then
  echo "Using system default krb5.conf path."
else
  echo "Using custom config path '$KRB5_CONFIG', contents below:"
  cat $KRB5_CONFIG
fi
# Export password to keytab
IFS=' ' read -a ENC_ARR &amp;lt;&amp;lt;&amp;lt; "$ENC_TYPES"
{
  for ENC in "${ENC_ARR[@]}"
  do
    echo "addent -password -p $USER -k $KVNO -e $ENC"
    if [ $SLEEP -eq 1 ]; then
      sleep 1
    fi
    echo "$PASSWD"
  done
  echo "wkt $KEYTAB_OUT"
} | ktutil

chmod 600 $KEYTAB_OUT

# Do a kinit to validate that everything works
kinit -k -t $KEYTAB_OUT $USER

# If this is not AD admin account, return from here
if [ "$AD_ADMIN" != "true" ]; then
  exit 0
fi

# With AD do a simple search to make sure everything works.
# Set properties needed for ldapsearch to work.
# Tell GSSAPI not to negotiate a security or privacy layer since
# AD doesn't support nested security or privacy layers
LDAP_CONF=`mktemp /tmp/cm_ldap.XXXXXXXX`
echo "TLS_REQCERT     never" &amp;gt;&amp;gt; $LDAP_CONF
echo "sasl_secprops   minssf=0,maxssf=0" &amp;gt;&amp;gt; $LDAP_CONF

export LDAPCONF=$LDAP_CONF

set +e # Allow failures to SASL so we can see if simple auth works
ldapsearch -LLL -H "$AD_SERVER" -b "$DOMAIN" "userPrincipalName=$USER"
if [ $? -ne 0 ]; then
  echo "ldapsearch did not work with SASL authentication. Trying with simple authentication"
  ldapsearch -LLL -H "$AD_SERVER" -b "$DOMAIN" -x -D $USER -w $PASSWD "userPrincipalName=$USER"
  if [ $? -ne 0 ]; then
    echo "Failed to do ldapsearch."
    echo "Please make sure Active Directory configuration is correctly specified and LDAP over SSL is enabled."
    exit 1
  fi
  # Simple authentication worked. Store the password in output file.
  echo -n $PASSWD &amp;gt; $KEYTAB_OUT
fi
set -e
rm -f $LDAP_CONF

&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Mar 2018 16:54:05 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Enabling-Keberos-for-cluster-fails-when-importing-KDC/m-p/65866#M48256</guid>
      <dc:creator>sandy05</dc:creator>
      <dc:date>2018-03-28T16:54:05Z</dc:date>
    </item>
    <item>
      <title>Re: Enabling Keberos for cluster fails when importing KDC account manager</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Enabling-Keberos-for-cluster-fails-when-importing-KDC/m-p/65964#M48257</link>
      <description>Hi, any solution pls..</description>
      <pubDate>Mon, 02 Apr 2018 10:49:49 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Enabling-Keberos-for-cluster-fails-when-importing-KDC/m-p/65964#M48257</guid>
      <dc:creator>sandy05</dc:creator>
      <dc:date>2018-04-02T10:49:49Z</dc:date>
    </item>
    <item>
      <title>Re: Enabling Keberos for cluster fails when importing KDC account manager</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Enabling-Keberos-for-cluster-fails-when-importing-KDC/m-p/65990#M48258</link>
      <description>&lt;P&gt;Any solution pls..&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Apr 2018 07:43:46 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Enabling-Keberos-for-cluster-fails-when-importing-KDC/m-p/65990#M48258</guid>
      <dc:creator>sandy05</dc:creator>
      <dc:date>2018-04-03T07:43:46Z</dc:date>
    </item>
    <item>
      <title>Re: Enabling Keberos for cluster fails when importing KDC account manager</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Enabling-Keberos-for-cluster-fails-when-importing-KDC/m-p/66091#M48259</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/4054"&gt;@bgooley&lt;/a&gt; I have updated the script, can you please check as its still failing&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 10:04:31 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Enabling-Keberos-for-cluster-fails-when-importing-KDC/m-p/66091#M48259</guid>
      <dc:creator>sandy05</dc:creator>
      <dc:date>2018-04-06T10:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: Enabling Keberos for cluster fails when importing KDC account manager</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Enabling-Keberos-for-cluster-fails-when-importing-KDC/m-p/66108#M48260</link>
      <description>&lt;P&gt;Hi Sandy,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;+ ktutil
+ for ENC in '"${ENC_ARR[@]}"'
+ echo 'addent -password -p cloudera-scm/REDACTED@PRICLUSTER.COM -k 1 -e aes256-cts:normal'
+ '[' 0 -eq 1 ']'
+ echo REDACTED
+ for ENC in '"${ENC_ARR[@]}"'
+ echo 'addent -password -p cloudera-scm/REDACTED@PRICLUSTER.COM -k 1 -e aes128-cts:normal'
+ '[' 0 -eq 1 ']'
+ echo REDACTED
+ for ENC in '"${ENC_ARR[@]}"'
+ echo 'addent -password -p cloudera-scm/REDACTED@PRICLUSTER.COM -k 1 -e des3-hmac-sha1:normal'
+ '[' 0 -eq 1 ']'
+ echo REDACTED
+ for ENC in '"${ENC_ARR[@]}"'
+ echo 'addent -password -p cloudera-scm/REDACTED@PRICLUSTER.COM -k 1 -e des-hmac-sha1:normal'
+ '[' 0 -eq 1 ']'
+ echo REDACTED
+ for ENC in '"${ENC_ARR[@]}"'
+ echo 'addent -password -p cloudera-scm/REDACTED@PRICLUSTER.COM -k 1 -e des-cbc-crc:normal'
+ '[' 0 -eq 1 ']'
+ echo REDACTED
+ echo 'wkt /var/run/cloudera-scm-server/cmf8091152271730902012.keytab'
addent: Bad encryption type while adding new entry
ktutil: Unknown request "REDACTED".  Type "?" for a request list.
addent: Bad encryption type while adding new entry
ktutil: Unknown request "REDACTED".  Type "?" for a request list.
addent: Bad encryption type while adding new entry
ktutil: Unknown request "REDACTED".  Type "?" for a request list.
addent: Bad encryption type while adding new entry
ktutil: Unknown request "REDACTED".  Type "?" for a request list.
addent: Bad encryption type while adding new entry
ktutil: Unknown request "REDACTED".  Type "?" for a request list.
+ chmod 600 /var/run/cloudera-scm-server/cmf8091152271730902012.keytab
chmod: cannot access `/var/run/cloudera-scm-server/cmf8091152271730902012.keytab': No such file or directory&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Base on the above information, I've noticed that you have set the encryption in&amp;nbsp;&lt;/P&gt;&lt;P&gt;CM UI&amp;gt; Administration&amp;gt; Setting&amp;gt; Kerberos&amp;gt; "Kerberos Encryption Types" as&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;- aes256-cts:normal&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;- aes128-cts:normal&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;- des3-hmac-sha1:normal&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;- des-hmac-sha1:normal&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;- des-cbc-crc:normal&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error I see is that while&amp;nbsp;ktutil&amp;nbsp;executed the command addent&amp;nbsp;it failed with "Bad encryption type while adding new entry"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Therefore, ktutil&amp;nbsp;failed to set &lt;FONT face="courier new,courier"&gt;-e encryption_type&lt;/FONT&gt;&amp;nbsp;for all 5 encryption types you've specified, so there was nothing to be written into a keytab (wkt&amp;nbsp;keytab) see: 'wkt /var/run/cloudera-scm-server/cmf8091152271730902012.keytab'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The&amp;nbsp;encryption type combination you've specified&amp;nbsp;is valid for &lt;FONT face="courier new,courier"&gt;kadmin/kadmin.local&lt;/FONT&gt; tool&amp;nbsp;where the &lt;FONT face="courier new,courier"&gt;-e&amp;nbsp;&lt;/FONT&gt;parameter&amp;nbsp;can be specified as&amp;nbsp;&lt;FONT face="courier new,courier"&gt;encryption:salt,&lt;/FONT&gt;&amp;nbsp;but it is not valid for &lt;FONT face="courier new,courier"&gt;ktutil -e encryption_type&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since&amp;nbsp;CM script is using &lt;FONT face="courier new,courier"&gt;ktutil&lt;/FONT&gt;&amp;nbsp;you may need to remove the salt suffixed ':normal'.&lt;/P&gt;&lt;P&gt;The salt :normal is default for Kerberos Version 5,&amp;nbsp;you only need to set the encryption type [0] in&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;CM UI&amp;gt; Administration&amp;gt; Setting&amp;gt; Kerberos&amp;gt; "Kerberos Encryption Types"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Encryption Type&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;- aes256-cts&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;- aes128-cts&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;- des3-hmac-sha1&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;- des-hmac-sha1&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;- des-cbc-crc&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Let me know if this helps,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Michalis&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;[0]&amp;nbsp;&lt;A href="https://web.mit.edu/kerberos/krb5-latest/doc/admin/conf_files/kdc_conf.html#encryption-types" target="_blank"&gt;https://web.mit.edu/kerberos/krb5-latest/doc/admin/conf_files/kdc_conf.html#encryption-types&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Note: A feature request OPSAPS-29768 is in progress to not allow manual entry in&amp;nbsp;&lt;SPAN&gt;"Kerberos Encryption Types"&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 16:57:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Enabling-Keberos-for-cluster-fails-when-importing-KDC/m-p/66108#M48260</guid>
      <dc:creator>michalis</dc:creator>
      <dc:date>2018-04-06T16:57:19Z</dc:date>
    </item>
    <item>
      <title>Re: Enabling Keberos for cluster fails when importing KDC account manager</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Enabling-Keberos-for-cluster-fails-when-importing-KDC/m-p/66110#M48261</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/27"&gt;@michalis&lt;/a&gt;&lt;/P&gt;&lt;P&gt;I removed the salt :normal while enabling kerberos using cloudera manager and it imported the kdc successfully..&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/4054"&gt;@bgooley&lt;/a&gt; and&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/27"&gt;@michalis&lt;/a&gt;&amp;nbsp; for the support and helping me to solve this tricky one.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 16:08:01 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Enabling-Keberos-for-cluster-fails-when-importing-KDC/m-p/66110#M48261</guid>
      <dc:creator>sandy05</dc:creator>
      <dc:date>2018-04-06T16:08:01Z</dc:date>
    </item>
  </channel>
</rss>

