how to set default TGT file path

Peng Hu PH Pei peipengh at
Wed Dec 24 03:45:54 EST 2014

Put in krb5.conf and run kinit, the TGT is still in /tmp/:

    default_ccache_name = FILE:/var/tmp/krb5cc_%{euid}

Penghu Pei
E-mail: peipengh at
Phone: 86-29-68797089 | 18792954566

From:	Greg Hudson <ghudson at>
To:	Shuaijie Wang <wangshuaijie at>, kerberos at, Peng
            Hu PH Pei/China/IBM at IBMCN
Date:	2014/12/24 00:16
Subject:	Re: how to set default TGT file path

On 12/23/2014 04:38 AM, Shuaijie Wang wrote:
> By default, kinit will generate TGT file under /tmp. Is there any way to
> specify other directory to put TGT in?

Gwenael already pointed out the KRB5CCNAME environment variable.  In
addition, MIT krb5 1.11 adds the default_ccache_name krb5.conf variable
with parameter expansion and the DEFCCNAME configure parameter.  These
two new variables support parameter expansion as documented here:

So for example, you could put in krb5.conf:

    default_ccache_name = FILE:/var/tmp/krb5cc_%{euid}

or at build time:

    ./configure DEFCCNAME='DIR:/var/krb5/%{username}'

More information about the Kerberos mailing list