I want to use kpasswd to change my password. Since I have to do it for multiple realms, I'd like to automate it passing on the password. I want to set a variable in bash and pass that on to kpasswd, somehow. :) Variable setting is no problem, but passing it on to kpasswd, that is an issue.
How would I do that?
From man kpasswd
it seems that there isn't some flag which I can pass along, so I was thinking using printf or some other solution. Unfortunately this doesn't work:
printf "$PWD\n$PWD\n" | kpasswd $KERBEROS_USERNAME@DOMAIN
Some other details:
$ bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin14)
$ kpasswd --version
kpasswd (Heimdal 1.5.1apple1)