I often have to get multiple Kerberos tickets and I do this with kinit [email protected]
for example. Then I have to enter my password. This is annoying. The script kinit-wrapper
helps me use the secret-tool
to store passwords in the default keyring on the first run and later pull them out of the keyring.
Here's an example of a first run:
$ kinit-wrapper
Checking for password for principal "[email protected]"...NO PASSWORD FOUND. Please, enter it in the next step!
Password:
Attempting to get a Kerberos token for principal "[email protected]"...OK
Checking for password for principal "[email protected]"...NO PASSWORD FOUND. Please, enter it in the next step!
Password:
Attempting to get a Kerberos token for principal "[email protected]"...OK
Checking for password for principal "[email protected]"...NO PASSWORD FOUND. Please, enter it in the next step!
Password:
Attempting to get a Kerberos token for principal "[email protected]"...OK
On a second run, I'm not asked for the password which is nice:
$ kdestroy -A && kinit-wrapper
Checking for password for principal "[email protected]"...FOUND
Attempting to get a Kerberos token for principal "[email protected]"...OK
Checking for password for principal "[email protected]"...FOUND
Attempting to get a Kerberos token for principal "[email protected]"...OK
Checking for password for principal "[email protected]"...FOUND
Attempting to get a Kerberos token for principal "[email protected]"...OK
In case there's an error getting a Kerberos token, we'll tell you and assume that most likely you've mistyped your password:
$ kdestroy -A && kinit-wrapper
Checking for password for principal "[email protected]"...FOUND
Attempting to get a Kerberos token for principal "[email protected]"...ERROR
Shall we remove the secret for principal "[email protected]" so that you can enter it again on the next run? (Y/N): Y
Removing password for principal "[email protected]".
Now run kinit-wrapper again!
When you run kinit-wrapper
again it will prompt for the password for that prinicipal again.