www.idziorek.net | blog | contact

Passoword Managemet from the Command Line

February 8, 2018

Today we will look at some simple, portable yet effective ways to manage your passwords from the command line. You will need nothing more than apg and one of gnugpg or openssl along with your favorite text editor.

Generate your Password

Before you can manage your passwords, you will obviously first have to generate them. Since your brain might be a very poor random number generator you can use /dev/random here.

A few examples for generating random passwords with apg follow:

Managing your Password Safe

Just put the passwords in a plaintext file (named mypasswords in the examples below), along with related data and encrypt them symmetrically via gnupg. Decrypt them as needed. You will be prompted for a passphrase in each case.

Note that gnupg might cache your password for a few minutes, so don’t worry if you can decrypt them without beeing prompted.

You might prefer openssl, which some claim to be even more portable

Adding, Editing or Deleting a password constitutes simply of the three steps: