Password managers have become an essential tool in 2023. Remembering every single password of every online account has become an impossibile task, and using a single password for everything isn’t really the best solution. For this reason it’s crucial to use a safe and uncomplicated password manager, like pass.
Overview
pass is a command-line password manager for Unix-like systems; Every password is stored in a GPG encrypted text file; These files are stored according to a user-defined structure, and can be modified, copied or deleted with ease.
Initial setup
First of all you’ll need to create a new GPG key pair. Type the following command:
gpg --full-generate-key
You’ll be asked:
- the key’s type
- the key’s length
- the key’s duration
- name, email, comment (you don’t have to type a real email address)
- the key’s passphrase (this will be used as the main pass password, DON’T FORGET IT)
Now you’ll have to retrieve the key’s ID with the following command:
gpg --list-secret-keys
Lastly, you can initialize a new password store with:
pass init <key-id>
You are now ready to use pass ✌️
Managing passwords
To add a password, just type:
pass insert <path>
If you want to generate a new password, type:
pass generate <path>
If you want to edit an already existing password, type:
pass edit <path>
Lastly, to retrieve a password, type one of the following commands:
pass <path>
pass -c <path>
Syncing with Git
You want to keep your passwords on multiple computers? No problem. The password store can be configured as a git repository, making it possible to sync all of your passwords across several hosts.
Of course, you’ll need to setup a remote repository; You can use a self-hosted repository or a cloud-based solution like GitHub (in such case make sure to set the repo as private).
The initial client-side setup is the following:
pass git init
pass git remote add origin <url>
pass git push --set-upstream origin <local-branch>
You can now use pass git pull
and pass git push
on every machine you have pass installed to keep the password store in sync ✌️