I was looking at this: http://docs.oracle.com/javase/7/docs/technotes/tools/windows/kinit.html and noticed that it says I could use the “password flag”. I am not sure how to do this though?
Can I enter the password for kinit without it prompting me?
For example currently:
If I type in:
$ kinit test@REALM
I get response:
test@REALM's password:
and I have to enter the password. Is there anyway I can input something like kinit test@REALM password so it doesn’t prompt me?
Use a keytab for that principal!
In detail: How do I a service keytab.
There are multiple ways, but I will assume the following: You are running Active Directory as your KDC implementation, you backend runs on a Unix or Unix-like OS like CentOS, FreeBSD, HP-UX, etc. You have also MIT Kerberos or Heimdal installed and the
krb5.confis properly configured.Install
msktutil(1)via package/ports manager or compile from source. If you choose to compile, make sure that all dependencies are present on your machine.Now run
mskutil:Replace
samAccountNameandpasswordwith your data. Leave outdont-change-passwordif you are fine with autogenerated passwords. Adjustpathwhere you want to store the keytab file.Sample run:
Now check your keytab with
kinit:This keytab is now ready to be used with your
login.conffor JGSS or withKRB5_CLIENT_KTNAMEand MIT Kerberos.