Change Passphrase in Batch Mode

Daniel Kilimnik kaleb.dk at gmail.com
Thu Mar 17 13:40:38 CET 2022


Thanks, that does work, but is is also possible to set an empty
passphrase i.e. remove the passphrase with this method?

Best,
Daniel

Am Do., 17. März 2022 um 10:26 Uhr schrieb Werner Koch <wk at gnupg.org>:

> On Wed, 16 Mar 2022 09:26, Daniel Kilimnik said:
>
> > mode. With --pinentry-mode loopback --passphrase-fd 0 activated. It asks
> > for my current passphrase, but then exits with a success.
>
> --passphrase-fd works only if a password is request but not if two
> passwords are quested (the old one and the new one).  You need to use
> the --command-fd thingy and write a state machine for this.  Here is a
> manual example
>
> --8<---------------cut here---------------start------------->8---
> $ gpg --pinentry-mode loopback --status-fd 2 -v --batch --command-fd 0
> --passwd FE894309B6844A3004FE8BF9476CAB1C3623CAA6
> [GNUPG:] KEY_CONSIDERED FE894309B6844A3004FE8BF9476CAB1C3623CAA6 0
> [GNUPG:] INQUIRE_MAXLEN 100
> [GNUPG:] GET_HIDDEN passphrase.enter
> abc
> [GNUPG:] GOT_IT
> [GNUPG:] INQUIRE_MAXLEN 100
> [GNUPG:] GET_HIDDEN passphrase.enter
> def
> [GNUPG:] GOT_IT
> [GNUPG:] SUCCESS keyedit.passwd
> --8<---------------cut here---------------end--------------->8---
>
>
> Salam-Shalom,
>
>    Werner
>
> --
> Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnupg-users/attachments/20220317/34bf22fc/attachment.html>


More information about the Gnupg-users mailing list