This page looks best with JavaScript enabled

Manage Passwords with Pass

 ·   ·  โ˜• 2 min read · ๐Ÿ‘€... views

introduction

Pass1 is a command line tool that manages (adding, editing, generating, retrieving) your passwords, but with many useful font-ends and ported clients for different platforms. Its very handy to use it for managing all your passwords on all your devices.

Each password lives in a gpg encrypted file.

init

Before everything, we need to initialize the password store with a GPG key (How to generate a gpg key):

1
2
3
4
# "Kyle Shi" is the user id (maybe email is better?) for my GPG key
# this will create a directory: $HOME\.password-store
# with a file .gpg-id in it (which stores this id)
pass init "Kyle Shi"

Passwords that you add will be stored in the .password-store directory, named xxx.gpg, which is encrypted with your gpg public key, which only you can decrypt with your private key (gpg --output doc --decrypt doc.gpg).

manage with pass command

add

1
pass insert Email/sky_io@outlook.com

generate

1
2
3
# generate password for an entry with length of 15
# if -n (--no-symbols) is passed: will not use non alphanumeric characters
pass generate Email/sky_io@outlook.com 15

edit

1
2
# edit an entry with your default editor
pass edit Email/sky_io@outlook.com

remove

1
pass rm Email/sky_io@outlook.com

retrieve

1
2
3
4
5
6
# list password entries
pass
# show password for an entry
pass Email/sky_io@outlook.com
# copy password of an entry to the clipboard
pass -c Email/sky_io@outlook.com

history problem with clipboard manager: How to clear the history in CopyQ?

manage with other pass front ends

We barely use pass command, instead we use other more user friendly front ends.

unix/unix like: rofi-pass

  • Alt+n: add new password
  • Alt+a: action menu of current password
  • Alt+h: help

windows

android

ios

Sync

git(hub)

1
2
3
4
5
6
7
cd $HOME\.password-store
git init
git branch -M main
git add -A
git commit -m "init pass store"
git remote add origin git@github.com:sky-bro/password-store.git
git push -u origin main

Adding and removing passwords will automatically create git commits.

browser settings

switch off Offer to save passwords in chrome settings


  1. pass is the standard unix password manager. ↩︎

Share on