protected boolean init(Map<String, String> kerberosConfiguration) throws KerberosOperationException {
    if (credentialsCacheFile != null) {
      if (!credentialsCacheFile.delete()) {
        LOG.debug("Failed to remove the orphaned cache file, {}", credentialsCacheFile.getAbsolutePath());
      }
      credentialsCacheFile = null;
    }

    try {
      credentialsCacheFile = File.createTempFile("ambari_krb_", "cc");
      credentialsCacheFile.deleteOnExit();
      ensureAmbariOnlyAccess(credentialsCacheFile);
    } catch (IOException e) {
      throw new KerberosOperationException(String.format("Failed to create the temporary file needed to hold the administrator ticket cache: %s", e.getLocalizedMessage()), e);
    }

    String credentialsCache = String.format("FILE:%s", credentialsCacheFile.getAbsolutePath());

    environmentMap = new HashMap<>();
    environmentMap.put("KRB5CCNAME", credentialsCache);

    PrincipalKeyCredential credentials = getAdministratorCredential();

    ShellCommandUtil.Result result = executeCommand(getKinitCommand(executableKinit, credentials, credentialsCache, kerberosConfiguration),
        environmentMap,
        new InteractivePasswordHandler(String.valueOf(credentials.getKey()), null));

    if (!result.isSuccessful()) {
      String message = String.format("Failed to kinit as the KDC administrator user, %s:\n\tExitCode: %s\n\tSTDOUT: %s\n\tSTDERR: %s",
          credentials.getPrincipal(), result.getExitCode(), result.getStdout(), result.getStderr());
      LOG.warn(message);
      throw new KerberosAdminAuthenticationException(message);
    }

    cachedKeytabs = new HashMap<>();

    return true;
  }
Initialize the Kerberos ticket cache using the supplied KDC administrator's credentials.
<p>
A randomly named temporary file is created to store the Kerberos ticket cache for this {@link KerberosOperationHandler}'s
session. The file will be removed upon closing when the session is complete.  The geneated ticket cache
filename is set in the environment variable map using the variable name "KRB5CCNAME". This will be passed
in for all relevant-system commands.

@return
@throws KerberosOperationException
ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KDCKerberosOperationHandler.java