Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

An employee will be leaving our company, and we have a directory tree containing a number of files, each holding a password for a specific service, and each file is encrypted to those who require it.

I'd like to try and list all the files which include a particular recipient, however I can't seem to find a way to ask gpg to list the keys for an encrypted file. The only way I know currently how to list the keys is to attempt a decryption of a file, but this would be useless for a search as it would require my passphrase about a billion times.

share|improve this question

It's been a while since I used GPG, but the --list-packets option might be of some use; otherwise, I'd suggest the following (assuming you can mount the remote directory on your local machine):

  1. Backup your local secret keyring
  2. Remove the passphrase from your secret key
  3. Mount the remote directory on your local machine
  4. Enumerate the locally mounted copy of your remote directory
  5. Reset the passphrase on (or restore the backup of) your secret keyring

Alternately, create a special copy of your secret keyring that you remove the passphrase from, and use --secret-keyring to specify it during the traversal.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.