26

I'm using kinit to log into a server that my sys admin didn't anticipate us using. It seems that the default location for the config file is /etc/krb5.conf, but I don't have root access so I can't edit this file to add a new server. How can I pass kinit a custom config file?

Shep
  • 7,990
  • 8
  • 49
  • 71

3 Answers3

28

OK, solved the problem: the default config file location can be overridden by setting the KRB5_CONFIG environment variable

Shep
  • 7,990
  • 8
  • 49
  • 71
21

I had the same issue today. Here's the command that worked for me, for future reference:

env KRB5_CONFIG=/path/to/custom/krb5.conf kinit <your..args..here> 
Cita Secari
  • 311
  • 2
  • 3
16

Try using

on Win -Djava.security.krb5.conf=C:/IBM/IBMSSO/krb5.ini

on non Win -Djava.security.krb5.conf=/opt/IBM/IBMSSO/krb5.conf

Example on Windows (with IBM Java)

java -Djava.security.krb5.conf=C:/IBM/IBMSSO/krb5.ini com.ibm.security.krb5.internal.tools.Kinit -k -t C:/IBM/IBMSSO/SSOICNTilo.keytab HTTP/myserver.123.com@123.COM
Romain
  • 19,910
  • 6
  • 56
  • 65
Tilo
  • 1,110
  • 3
  • 21
  • 42
  • 7
    For kinit.exe, the parameter has to be in quotes: `kinit.exe -J-Dsun.security.krb5.debug=true -J-D"java.security.krb5.conf=C:\mypath\my_krb5.ini"` – Olivier Faucheux Aug 21 '15 at 11:54