[pass] Reused passwords, searching for passwords

Matthew Cengia mattcen at gmail.com
Thu Apr 10 04:19:05 CEST 2014

On 2014-04-09 22:28, Oliver Hunt wrote:
> What would be the best way of showing which passwords have been used more
> than once, i.e. for two different websites?

Probably not the *best* way, but certainly one that works:

  find ~/.password-store/ -name '*.gpg' -exec sh -c 'printf "%s " "$1";
  gpg --quiet --batch -d "$1" | head -1' _ {} \; | sort -k2 | uniq -df1

Note that this only shows *one* of the many websites using each
password. Combine it with the below code to then search for that
password in other sites.

Alternatively, if your 'uniq' has the -D option (capital as opposed to
lowercase), use that instead of the -d option to get what you want.

> Also, searching for sites/entries with a password that matches a certain
> password?

In the absense of a 'pass grep' command:

find ~/.password-store/ -name '*.gpg' -exec sh -c 'gpg --quiet --batch -d "$1" |
grep -q PASSWORD && echo "$1"' _ {} \;

Matthew Cengia
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 966 bytes
Desc: Digital signature
URL: <http://lists.zx2c4.com/pipermail/password-store/attachments/20140410/9d8eefb5/attachment.asc>

More information about the Password-Store mailing list