Simplify Password Management with the 'pass' Command-Line Password Manager
Anant Mishra
Posted on June 30, 2023
Introduction
In this blog post, we will explore the Pass - command-line password manager, which provides a secure and convenient way to manage your passwords. We will start with the initial setup, including generating a GPG key, and then proceed to cover storing, retrieving, and removing passwords using 'pass'. We will also discuss additional tips and best practices for using 'pass' effectively.
Initial setup
π Generating a GPG Key
The first step to setting up the 'pass' password manager is generating a GPG (GNU Privacy Guard) key. GPG provides encryption and decryption functionality, securing your passwords in the 'pass' password store. To generate a GPG key, use the following command:
$ gpg --gen-key
You will be prompted to enter your name and email address. Additionally, you will be asked to set a passphrase.
Note
This passphrase is crucial as it acts as the master password for all your passwords, so make sure to choose a strong and memorable passphrase.
Copy your GPG Key 6G5E33C8EDF352343243256F23FW23A06C20 from the output
pub ...
6G5E33C8EDF352343243256F23FW23A06C20
π Installing pass
Next, you need to install the 'pass' password manager on your system. The installation process may vary depending on your distribution. Here are a few examples:
A random password will be generated and stored under the specified label.
Retrieving passwords
To retrieve your stored passwords, you will need to provide the passphrase you set during the GPG key generation. Here are two ways to retrieve passwords:
Show password in terminal
$ pass show github/personal
YOUR_PASSWORD
Copy password in clipboard for 45 seconds
$ pass show -c github/personal
Copied github/personal to clipboard. Will clear in 45 seconds.
Removing passwords
$ pass rm github/personal
Are you sure you would like to delete github/personal? [y/N]
removed '/home/USER/.password-store/github/personal.gpg'
Remember to refer to the 'pass' documentation or run man pass in the terminal for more detailed information on additional features and advanced usage of the 'pass' command-line password manager.