Using pass in a team

The “standard unix password manager” pass is a great tool if you want to have full control over your password store and want it to be accessible by various systems. If you want to share the password store across your team, pass requires some more steps to set it up. This article describes how to organize and encrypt such a shared password store.

Requirements

In order to run the commands below you’ll need to have the and tools installed. You will also need your own private/public key and your teammate’s public keys set up. For more information check the pass and gpg documentation.

Let’s get started

Assume a company called Acme with team members:

  • Alice (alice@acme.org)
  • Jane (jane@acme.org)
  • Bob (bob@acme.org)

Alice will manage and encrypt the password store in a way that it’s decipherable by Jane and Bob.

Let’s start with initializing an empty password store:

This will create a folder in the user’s home directory. All passwords can be organized in files & folders inside of the folder. A shared password store should be organized in it’s own subfolder which can be done using the option:

This command will create the subfolder in the folder.

Let’s create a sample password:

This will generate a new password in the subfolder. By now, only Alice can decrypt the password.

Using multiple gpg ids

The command creates a file in the folder. This file includes the public gpg ids which will be used to encrypt the password files. In order to share a password store with your teammates you need to specify their gpg ids in the file and re-encrypt the passwords.

Open the file in an editor and add the public gpg ids:

Now, it’s important to (locally) sign the keys of your teammates using :

Repeat the steps for every entry in the file. Of course, only sign the keys if you fully trust them.

After this, re-initialize the shared password store with:

This will re-encrypt the passwords in the subfolder using the gpg ids specified in .

Now you are ready to share the encrypted password store with your teammates. Alice, Jane and Bob can decrypt the password with:

Sharing options

Since the password store is organized using plain files & folders, you can just copy the folder to a device and share it with your team. They would need to have pass installed with an (empty) password store and copy the folder to their “.password-store” folder.

Another way of sharing the password store is by using . Alice, who created the subfolder, can just add this folder to git and push it to a remote server.

The teammates can then clone the repo to their .

Updating the password store

Whenever you add a new password to the password store, you need to re-initialize (and re-encrypt) the password store with:

The command also needs to be run if you edit the file (adding or removing users).

If you use git, then commit and push the changes so that your teammates can update the password store.

Summary

In order to create a shared password store you need to:

  • Create a subfolder in your password store:
  • Add your teammate’s public gpg ids to the file
  • Locally sign the public keys

  • Re-encrypt the password store with:

Ruby developer | Hacking on the basic income @meinbge

Ruby developer | Hacking on the basic income @meinbge