Welcome to bytebang » The blog about all and nothing » Manage your passwords with pass

Manage your passwords with pass

Oct 14 2020

The Problem

Everybody knows that passwords should have a certain amount of characters, numbers and special signs in it - which makes them hard to remember.

If you have a lot of different accounts then it is a good idea to store your passwords somewhere. People are coming up with different solutions to this problem

  • Sticky note under the keyboard -> not a really good idea
  • Excel Files -> Also not good, because these can be scanned by the windows search routine
  • Password managers -> GOOD IDEA

Within the Windows world, I would recomment KeePass as password manager. It is secure, fast and easy to use ... but what tool should the plain linux user use ?

The Solution

Password management should be simple and follow Unix philosophy. With pass, each password lives inside of a gpg encrypted file whose filename is the title of the website or resource that requires the password. These encrypted files may be organized into meaningful folder hierarchies, copied from computer to computer, and, in general, manipulated using standard command line file management utilities.

pass makes managing these individual password files extremely easy. All passwords live in /.password-store, and pass provides some nice commands for adding, editing, generating, and retrieving passwords. It is a very short and simple shell script. It's capable of temporarily putting passwords on your clipboard and tracking password changes using git.

Depending on your needs, you propably want to have a printed list of all your passwords in the store. (e.g. for storing it within a safe or so). Here is a little bash command which generates a printable pdf of all passwords:

for pwf in $(find . -type f | sed  -e 's/.gpg//g' | sed -e 's/\.\///g'); do echo " " >> out.md; echo "# $pwf" >> out.md; echo "~~~~~~~~~~" >> out.md; pass show $pwf >> out.md; echo " " >> out.md; echo "~~~~~~~~~~" >> out.md; done && pandoc ./out.md -t latex -o out.pdf && rm out.pdf

This script should be started from within the /.password-store directory and from there it traverses all entries, writes them into a markdown file which gets afterwards compiled to a pdf via pandoc.

Get Social

(c) 2024, by bytebang e.U. - Impressum - Datenschutz / Nutzungsbedingungen