<?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: hi, I have changed the krb5.conf ticket expiration and renewal time both to 30 second. Now if i create a ticket using kinit, it gets expired in 30 sec while if I write a java program and provide userPrincipal and keytab there, it wont expire in 30 sec. in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/hi-I-have-changed-the-krb5-conf-ticket-expiration-and/m-p/167557#M49805</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/14572/priyanshu770bindal.html" nodeid="14572"&gt;@priyanshu bindal&lt;/A&gt;&lt;/P&gt;&lt;P&gt;In your "krb5.conf"  how have you defined the expiration?&lt;/P&gt;&lt;P&gt;I can see it working like following &lt;EM&gt;in  &lt;STRONG&gt;/etc/krb5.conf&lt;/STRONG&gt;&lt;/EM&gt;&lt;STRONG&gt;&lt;/STRONG&gt;:&lt;/P&gt;&lt;PRE&gt;[libdefaults]
  renew_lifetime = 7d
  forwardable = true
  default_realm = EXAMPLE.COM
  ticket_lifetime = 30m
&lt;/PRE&gt;&lt;P&gt;- See here i am setting&lt;EM&gt;&lt;STRONG&gt; [ticket_lifetime = 30m] &lt;/STRONG&gt;&lt;/EM&gt;30 minute and i can see the following &lt;EM&gt;in&lt;STRONG&gt;/etc/krb5.conf&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;:&lt;/P&gt;&lt;PRE&gt;[root@kjss1 ~]# kdestroy
[root@kjss1 ~]# kinit -kt /etc/security/keytabs/hdfs.headless.keytab hdfs-JoyCluster@EXAMPLE.COM 
[root@kjss1 ~]# klist
Ticket cache: FILE:/tmp/krb5cc_0
Default principal: hdfs-JoyCluster@EXAMPLE.COM

Valid starting     Expires            Service principal
12/22/16 07:18:12  12/22/16 07:48:12  krbtgt/EXAMPLE.COM@EXAMPLE.COM
    renew until 12/22/16 07:18:12&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;Similarly for 30 seconds i did the following&lt;EM&gt;&lt;STRONG&gt; [ticket_lifetime = 30s]&lt;/STRONG&gt; in&lt;STRONG&gt; &lt;/STRONG&gt;&lt;STRONG&gt;/etc/krb5.conf&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;PRE&gt;[root@kjss1 ~]# kdestroy
[root@kjss1 ~]# kinit -kt /etc/security/keytabs/hdfs.headless.keytab hdfs-JoyCluster@EXAMPLE.COM 
[root@kjss1 ~]# klist
Ticket cache: FILE:/tmp/krb5cc_0
Default principal: hdfs-JoyCluster@EXAMPLE.COM

Valid starting     Expires            Service principal
12/22/16 07:22:12  12/22/16 07:22:42  krbtgt/EXAMPLE.COM@EXAMPLE.COM
    renew until 12/22/16 07:22:12&lt;/PRE&gt;&lt;P&gt;- &lt;/P&gt;&lt;P&gt;&lt;A href="http://web.mit.edu/Kerberos/krb5-1.12/doc/basic/date_format.html#duration" target="_blank"&gt;http://web.mit.edu/Kerberos/krb5-1.12/doc/basic/date_format.html#duration&lt;/A&gt;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;</description>
    <pubDate>Thu, 22 Dec 2016 15:21:48 GMT</pubDate>
    <dc:creator>jsensharma</dc:creator>
    <dc:date>2016-12-22T15:21:48Z</dc:date>
    <item>
      <title>hi, I have changed the krb5.conf ticket expiration and renewal time both to 30 second. Now if i create a ticket using kinit, it gets expired in 30 sec while if I write a java program and provide userPrincipal and keytab there, it wont expire in 30 sec.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/hi-I-have-changed-the-krb5-conf-ticket-expiration-and/m-p/167554#M49802</link>
      <description>&lt;P&gt;Kindly help me to understand the logic.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2016 13:16:54 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/hi-I-have-changed-the-krb5-conf-ticket-expiration-and/m-p/167554#M49802</guid>
      <dc:creator>priyanshu770bin</dc:creator>
      <dc:date>2016-12-22T13:16:54Z</dc:date>
    </item>
    <item>
      <title>Re: hi, I have changed the krb5.conf ticket expiration and renewal time both to 30 second. Now if i create a ticket using kinit, it gets expired in 30 sec while if I write a java program and provide userPrincipal and keytab there, it wont expire in 30 sec.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/hi-I-have-changed-the-krb5-conf-ticket-expiration-and/m-p/167555#M49803</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/14572/priyanshu770bindal.html" nodeid="14572"&gt;@priyanshu bindal&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Can you please check if your Java Program is pointing to the correct krb5.conf? Normally in Linux environment it's value is "/etc/krb5.conf". However we can locate it as per "Locating the krb5.conf Configuration File" :  &lt;A href="https://docs.oracle.com/javase/8/docs/technotes/guides/security/jgss/tutorials/KerberosReq.html" target="_blank"&gt;https://docs.oracle.com/javase/8/docs/technotes/guides/security/jgss/tutorials/KerberosReq.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Usually we set the path for this file using java property:  &lt;EM&gt;&lt;STRONG&gt;"-Djava.security.krb5.conf"
&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;- Also we can debug what's going on using the &lt;EM&gt;&lt;STRONG&gt;"-Dsun.security.krb5.debug=true&lt;/STRONG&gt;&lt;/EM&gt;" Java option.&lt;/P&gt;&lt;P&gt;.
&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2016 13:23:17 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/hi-I-have-changed-the-krb5-conf-ticket-expiration-and/m-p/167555#M49803</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2016-12-22T13:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: hi, I have changed the krb5.conf ticket expiration and renewal time both to 30 second. Now if i create a ticket using kinit, it gets expired in 30 sec while if I write a java program and provide userPrincipal and keytab there, it wont expire in 30 sec.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/hi-I-have-changed-the-krb5-conf-ticket-expiration-and/m-p/167556#M49804</link>
      <description>&lt;P&gt;Hi Jay, after adding these 2 properties, my program is reading from /etc/krb5.conf but it is creating a ticket for 24 hour instead of 30 sec.
Following is the debug message:&lt;/P&gt;&lt;P&gt;
Found ticket for hbase/ip@domain to go to krbtgt/domain@REALM expiring on Fri Dec 23 12:00:07 IST 2016
Entered Krb5Context.initSecContext with state=STATE_NEW
Found ticket for hbase/ip@REALM to go to krbtgt/domain@REALM expiring on Fri Dec 23 12:00:07 IST 2016
Service ticket not found in the subject
&amp;gt;&amp;gt;&amp;gt; Credentials acquireServiceCreds: same realm
Using builtin default etypes for default_tgs_enctypes
default etypes for default_tgs_enctypes: 18 17 16 23 1 3.
&amp;gt;&amp;gt;&amp;gt; CksumType: sun.security.krb5.internal.crypto.RsaMd5CksumType
&amp;gt;&amp;gt;&amp;gt; EType: sun.security.krb5.internal.crypto.Aes256CtsHmacSha1EType
&amp;gt;&amp;gt;&amp;gt; KrbKdcReq send: kdc=kdc.domain UDP:88, timeout=30000, number of retries =3, #bytes=714
&amp;gt;&amp;gt;&amp;gt; KDCCommunication: kdc=kdc.domain UDP:88, timeout=30000,Attempt =1, #bytes=714
&amp;gt;&amp;gt;&amp;gt; KrbKdcReq send: #bytes read=725
&amp;gt;&amp;gt;&amp;gt; KdcAccessibility: remove kdc.domain
&amp;gt;&amp;gt;&amp;gt; EType: sun.security.krb5.internal.crypto.Aes256CtsHmacSha1EType
&amp;gt;&amp;gt;&amp;gt; KrbApReq: APOptions are 00100000 00000000 00000000 00000000
&amp;gt;&amp;gt;&amp;gt; EType: sun.security.krb5.internal.crypto.Aes256CtsHmacSha1EType.&lt;/P&gt;&lt;P&gt; Please let me know from where it is reading to create a ticket for 24 hour&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2016 14:57:05 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/hi-I-have-changed-the-krb5-conf-ticket-expiration-and/m-p/167556#M49804</guid>
      <dc:creator>priyanshu770bin</dc:creator>
      <dc:date>2016-12-22T14:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: hi, I have changed the krb5.conf ticket expiration and renewal time both to 30 second. Now if i create a ticket using kinit, it gets expired in 30 sec while if I write a java program and provide userPrincipal and keytab there, it wont expire in 30 sec.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/hi-I-have-changed-the-krb5-conf-ticket-expiration-and/m-p/167557#M49805</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/14572/priyanshu770bindal.html" nodeid="14572"&gt;@priyanshu bindal&lt;/A&gt;&lt;/P&gt;&lt;P&gt;In your "krb5.conf"  how have you defined the expiration?&lt;/P&gt;&lt;P&gt;I can see it working like following &lt;EM&gt;in  &lt;STRONG&gt;/etc/krb5.conf&lt;/STRONG&gt;&lt;/EM&gt;&lt;STRONG&gt;&lt;/STRONG&gt;:&lt;/P&gt;&lt;PRE&gt;[libdefaults]
  renew_lifetime = 7d
  forwardable = true
  default_realm = EXAMPLE.COM
  ticket_lifetime = 30m
&lt;/PRE&gt;&lt;P&gt;- See here i am setting&lt;EM&gt;&lt;STRONG&gt; [ticket_lifetime = 30m] &lt;/STRONG&gt;&lt;/EM&gt;30 minute and i can see the following &lt;EM&gt;in&lt;STRONG&gt;/etc/krb5.conf&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;:&lt;/P&gt;&lt;PRE&gt;[root@kjss1 ~]# kdestroy
[root@kjss1 ~]# kinit -kt /etc/security/keytabs/hdfs.headless.keytab hdfs-JoyCluster@EXAMPLE.COM 
[root@kjss1 ~]# klist
Ticket cache: FILE:/tmp/krb5cc_0
Default principal: hdfs-JoyCluster@EXAMPLE.COM

Valid starting     Expires            Service principal
12/22/16 07:18:12  12/22/16 07:48:12  krbtgt/EXAMPLE.COM@EXAMPLE.COM
    renew until 12/22/16 07:18:12&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;Similarly for 30 seconds i did the following&lt;EM&gt;&lt;STRONG&gt; [ticket_lifetime = 30s]&lt;/STRONG&gt; in&lt;STRONG&gt; &lt;/STRONG&gt;&lt;STRONG&gt;/etc/krb5.conf&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;PRE&gt;[root@kjss1 ~]# kdestroy
[root@kjss1 ~]# kinit -kt /etc/security/keytabs/hdfs.headless.keytab hdfs-JoyCluster@EXAMPLE.COM 
[root@kjss1 ~]# klist
Ticket cache: FILE:/tmp/krb5cc_0
Default principal: hdfs-JoyCluster@EXAMPLE.COM

Valid starting     Expires            Service principal
12/22/16 07:22:12  12/22/16 07:22:42  krbtgt/EXAMPLE.COM@EXAMPLE.COM
    renew until 12/22/16 07:22:12&lt;/PRE&gt;&lt;P&gt;- &lt;/P&gt;&lt;P&gt;&lt;A href="http://web.mit.edu/Kerberos/krb5-1.12/doc/basic/date_format.html#duration" target="_blank"&gt;http://web.mit.edu/Kerberos/krb5-1.12/doc/basic/date_format.html#duration&lt;/A&gt;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2016 15:21:48 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/hi-I-have-changed-the-krb5-conf-ticket-expiration-and/m-p/167557#M49805</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2016-12-22T15:21:48Z</dc:date>
    </item>
    <item>
      <title>Re: hi, I have changed the krb5.conf ticket expiration and renewal time both to 30 second. Now if i create a ticket using kinit, it gets expired in 30 sec while if I write a java program and provide userPrincipal and keytab there, it wont expire in 30 sec.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/hi-I-have-changed-the-krb5-conf-ticket-expiration-and/m-p/167558#M49806</link>
      <description>&lt;P&gt;Hi, this is a Java bug, and fixed in Java 9&lt;/P&gt;&lt;P&gt;see:&lt;/P&gt;&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/38555244/how-do-you-set-the-kerberos-ticket-lifetime-from-java" target="_blank"&gt;https://stackoverflow.com/questions/38555244/how-do-you-set-the-kerberos-ticket-lifetime-from-java&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8044500" target="_blank"&gt;https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8044500&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jan 2018 17:07:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/hi-I-have-changed-the-krb5-conf-ticket-expiration-and/m-p/167558#M49806</guid>
      <dc:creator>iusepython</dc:creator>
      <dc:date>2018-01-15T17:07:42Z</dc:date>
    </item>
  </channel>
</rss>

