<?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 Cloubdreak on Azure Kerberos configuration hostnames too long in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Cloubdreak-on-Azure-Kerberos-configuration-hostnames-too/m-p/203252#M165255</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am setting up a Kerberized cluster with Cloudbreak 2.7 on Azure.  We have created a cluster install using simple options and it all works well, however, once we come to installing a cluster using Kerberos we are running into an error when creating the principals.&lt;/P&gt;&lt;P&gt;Failed to create the account for HTTP/hostname.guid.px.internal.cloudapp.net@EXAMPLE.COM&lt;/P&gt;&lt;P&gt;it seems that the principal is too long to fit into the 64 char limit that we have in Active Directory due to the hostname being too long.  &lt;/P&gt;&lt;P&gt;My questions are &lt;/P&gt;&lt;P&gt;Is there a way around this issue?&lt;/P&gt;&lt;P&gt;Has anyone else managed to setup kerberos on Azure using Active Directory, if so how?&lt;/P&gt;&lt;P&gt;Thanks for any help that can be provided.&lt;/P&gt;</description>
    <pubDate>Fri, 03 Aug 2018 10:02:08 GMT</pubDate>
    <dc:creator>james_bashforth</dc:creator>
    <dc:date>2018-08-03T10:02:08Z</dc:date>
    <item>
      <title>Cloubdreak on Azure Kerberos configuration hostnames too long</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Cloubdreak-on-Azure-Kerberos-configuration-hostnames-too/m-p/203252#M165255</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am setting up a Kerberized cluster with Cloudbreak 2.7 on Azure.  We have created a cluster install using simple options and it all works well, however, once we come to installing a cluster using Kerberos we are running into an error when creating the principals.&lt;/P&gt;&lt;P&gt;Failed to create the account for HTTP/hostname.guid.px.internal.cloudapp.net@EXAMPLE.COM&lt;/P&gt;&lt;P&gt;it seems that the principal is too long to fit into the 64 char limit that we have in Active Directory due to the hostname being too long.  &lt;/P&gt;&lt;P&gt;My questions are &lt;/P&gt;&lt;P&gt;Is there a way around this issue?&lt;/P&gt;&lt;P&gt;Has anyone else managed to setup kerberos on Azure using Active Directory, if so how?&lt;/P&gt;&lt;P&gt;Thanks for any help that can be provided.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 10:02:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Cloubdreak-on-Azure-Kerberos-configuration-hostnames-too/m-p/203252#M165255</guid>
      <dc:creator>james_bashforth</dc:creator>
      <dc:date>2018-08-03T10:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: Cloubdreak on Azure Kerberos configuration hostnames too long</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Cloubdreak-on-Azure-Kerberos-configuration-hostnames-too/m-p/203253#M165256</link>
      <description>&lt;P&gt;There is a workaround for this issue.  However the results may not be desired since the CN will be a set of seemingly random characters.  &lt;/P&gt;&lt;P&gt;The CN is set using the value calculated using the Velocity template specified in the &lt;STRONG&gt;&lt;EM&gt;kerberos-env/ad_create_attributes_template&lt;/EM&gt;&lt;/STRONG&gt; configuration. 
The default value of the template is &lt;/P&gt;&lt;PRE&gt;{
  "objectClass": ["top", "person", "organizationalPerson", "user"],
  "cn": "$principal_name",
  #if( $is_service )
  "servicePrincipalName": "$principal_name",
  #end
  "userPrincipalName": "$normalized_principal",
  "unicodePwd": "$password",
  "accountExpires": "0",
  "userAccountControl": "66048"
} &lt;/PRE&gt;&lt;P&gt;As you can see, the CN value is set to the identity's principal name.  This can be changed, but we need to make sure the value will be unique.  There are several variables available to use in this template.  See &lt;A href="http://ttps//docs.hortonworks.com/HDPDocuments/Ambari-2.6.1.5/bk_ambari-security/content/customizing_the_attribute_template.html" target="_blank"&gt;https://docs.hortonworks.com/HDPDocuments/Ambari-2.6.1.5/bk_ambari-security/content/customizing_the_attribute_template.html&lt;/A&gt;. &lt;/P&gt;&lt;P&gt;You can use one of the hashes to limit the size of the value and provide a reasonable probability of uniqueness: &lt;/P&gt;&lt;UL&gt;&lt;LI&gt;principal_digest (SHA1) - 40 characters&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;principal_digest_256 (SHA256) - 64 characters &lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;principal_digest_512 (SHA512) -  128 characters&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Since the maximum length for the CN attribute in an Active Directory is 64 characters, I would suggest using &lt;STRONG&gt;&lt;EM&gt;principal_digest_256. &lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;For example, &lt;/P&gt;&lt;PRE&gt;{
  "objectClass": ["top", "person", "organizationalPerson", "user"],
  "cn": "$principal_digest_256",
  #if( $is_service )
  "servicePrincipalName": "$principal_name",
  #end
  "userPrincipalName": "$normalized_principal",
  "unicodePwd": "$password",
  "accountExpires": "0",
  "userAccountControl": "66048"
} &lt;/PRE&gt;&lt;P&gt;Notice the "cn" line was changed from &lt;STRONG&gt;"cn": "$principal_name"&lt;/STRONG&gt; to &lt;STRONG&gt;"cn": "$principal_digest_256"&lt;/STRONG&gt;.  &lt;/P&gt;&lt;P&gt;You can change this templet from the &lt;STRONG&gt;Enable Kerberos Wizard&lt;/STRONG&gt; if you open the &lt;STRONG&gt;Advanced kerberos-env&lt;/STRONG&gt; tab on the &lt;STRONG&gt;Configure Kerberos&lt;/STRONG&gt; page and look for the &lt;STRONG&gt;Account Attribute Template&lt;/STRONG&gt; property. &lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 10:19:31 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Cloubdreak-on-Azure-Kerberos-configuration-hostnames-too/m-p/203253#M165256</guid>
      <dc:creator>rlevas</dc:creator>
      <dc:date>2018-08-03T10:19:31Z</dc:date>
    </item>
  </channel>
</rss>

