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
Create a keytab using "ktutil"
> ktutil
ktutil: addent -password -p username@domain.com -k 1 -e rc4-hmac
Password for username@domain.com: [enter your password]
ktutil: addent -password -p username@domain.com -k 1 -e aes256-cts
Password for username@domain.com: [enter your password]
ktutil: wkt username.keytab
ktutil: quit
# Below steps will will create a keytab for the user, move it into a secure directory,
and automatically get a ticket when the user logs in with a bash shell
mkdir /home/username/keytabs
chmod 700 /home/username/keytabs
mv username.keytab /home/username/keytabs
chmod 600 /home/username/keytabs/username.keytab
echo "kinit -kt /home/username/keytabs/username.keytab username@domain.com" >> /home/username/.bash_profile
Command to pass keytab and login
kinit username@domain.com -k -t /path/to/username.keytab
Reference link hortonworks kb.iu.edu