Debian based systems, use apt-get or apt package manager to install pass.
$ sudo apt-get install pass
How to generate GPG key pair
Make sure you have your own GPG key pair. If no, create a GPG key pair by running following command on terminal and follow the instructions.
$ gpg --gen-key
The above command will ask a series of questions to create a GPG key pair, so input the required details carefully and few question you can leave default answer which is enough.
Initiate the password store
If you got a GPG key pair then initialize the local password store by running the following command, you can pass either email-id or gpg-id
.
$ pass init tcb
mkdir: created directory '/home/magi/.password-store/'
Password store initialized for tcb
The above command will create a password store under ~/.password-store
directory.
pass command is offering simple syntax to manage password. Let’s see one by one like adding, editing, generating, and retrieving passwords.
Insert a new password info
$ pass insert tcb/email
mkdir: created directory '/home/tcb/.password-store/tcb'
Enter password for tcb/email:
Retype password for tcb/email:
We can list all the existing passwords in the store.
$ pass show
Password Store
├── 2g
├── Bank
├── tcb
│ ├── email
│ └── email2
├── eMail
├── Social
│ ├── Facebook_2daygeek
│ └── Gplus_2daygeek
├── Social
Using the password store
Show passwords
$ zx2c4@laptop ~ $ pass Email/zx2c4.com
sup3rh4x3rizmynam3
dd existing passwords to the store with insert
:
$ zx2c4@laptop ~ $ pass insert Business/cheese-whiz-factory
Enter password for Business/cheese-whiz-factory: omg so much cheese what am i gonna do
This also handles multiline passwords or other data with --multiline
or -m
, and passwords can be edited in your default text editor using pass edit pass-name
.
he utility can generate
new passwords using /dev/urandom
internally:
$ zx2c4@laptop ~ $ pass generate Email/jasondonenfeld.com 15
The generated password to Email/jasondonenfeld.com is:
$(-QF&Q=IN2nFBx
It’s possible to generate passwords with no symbols using --no-symbols
or -n
And of course, passwords can be removed:
$ zx2c4@laptop ~ $ pass rm Business/cheese-whiz-factory
rm: remove regular file ‘/home/zx2c4/.password-store/Business/cheese-whiz-factory.gpg’? y
removed ‘/home/zx2c4/.password-store/Business/cheese-whiz-factory.gpg’