gpg script to remove passphrase from secret key

Kai-Min Sung kaisung at gmail.com
Tue Mar 29 04:43:12 CEST 2005


Nevermind, I think I figured it out.  Here's the command to use:

gpg --status-fd 1 --command-fd 0 --edit-key user at domain.com < input

and here's the input file:

---input start---
passwd
old_pass

Y
save
Y

---input end---

Replace the first blank line with a new passphrase if you want to
change the passphrase instead of removing it.

Cheers,
-Kai


On Mon, 28 Mar 2005 17:27:23 -0800, Kai-Min Sung <kaisung at gmail.com> wrote:
> Hi,
> 
> I'm trying to write a script that will remove the passphrase from a
> secret key.  Here's the command I'm using:
> 
> gpg --passphrase-fd 0 --command-fd 0 --edit-key user at domain.com < input
> 
> The input file looks like:
> 
> ---input start---
> oldpassphrase
> passwd
> 
> save
> quit
> Y
> ---input end---
> 
> gpg doesn't seem to be reading the new passphrase from fd 0. The man
> page says --passphrase-fd will only work if you're using one
> passphrase, which is probably why this fails. Is there any other way
> to make this work?
> 
> Thanks in advance,
> -Kai
>



More information about the Gnupg-users mailing list