3 password store
pitchum edited this page 2021-10-02 08:26:04 +02:00

How to use the password-store

Read a password

You need to have at least the private key of one of public present keys in the password-store/.gpg-id file.

  1. sudo apt install pass
  2. export PASSWORD_STORE_DIR=$PWD/password-store
  3. pass

Add a new person to the store

# Make pass aware of the non-standard path for our store
export PASSWORD_STORE_DIR=$PWD/password-store

# Get the public gpg key of the person
gpg --search-keys <someone>
# Ask that perspon a copy of the public key if it's not
# publicly available

# Keep a copy of this key in our git repo
gpg --export --armor <somone> >> gpg_keys/someone.pub.gpg

# Import all the keys in your gpg keyring
gpg --import gpg_keys/*

# Set maximum trust level to all these keys
gpg --edit-key THE_ID_OF_A_KEY
gpg> trust
# then select the 4th choice at least
gpg> quit

# Add the new gpg pub key id to the password-store
echo "THE_ID_OF_A_KEY" >> ${PASSWORD_STORE_DIR}/.gpg-id

# Re-encrypt all the pass files with all the keys
pass init $(cat ${PASSWORD_STORE_DIR}/.gpg-id | tr "\n" " ")

# Don't forget to share the changes :)
git commit -m "Give access to password-store to <someone>"
git push