Skip to content

Instantly share code, notes, and snippets.

@peterwwillis
Created December 3, 2019 21:59
Show Gist options
  • Save peterwwillis/5c484a2d127856df21f31fcb0bdce43b to your computer and use it in GitHub Desktop.
Save peterwwillis/5c484a2d127856df21f31fcb0bdce43b to your computer and use it in GitHub Desktop.
Using the Unix tool `pass` to manage passwords

About

This document explains how to use the Unix tool pass to manage passwords.

Using pass

Initial set-up

  1. Install software
  1. Generate a GPG key
  • $ gpg -v --quick-generate-key EMAIL-ADDRESS
  1. Set up pass store
  • $ pass init EMAIL-ADDRESS
  • $ pass git init

How to generate a new password

  • $ pass generate Category/Site/User

How to insert an existing password

  • $ pass insert -m Category/Site/User
    • This creates a multi-line password. It is suggested to make the first line the password, and any additional lines can contain metadata.
    • If this is to be used with automation, it is recommended you encode the password as a JSON blob.

How to list all stored passwords

  • $ pass ls

How to display a password

  • $ pass show Category/Site/User

How to copy a password into your clipboard

  • $ pass show --clip Category/Site/User
    • Using SSH with X11 forwarding, along with a rootless X11 server on your local machine, allows you to transfer the password into your OS's clipboard.

How to edit a password

  • $ pass edit Category/Site/User

How to remove a password

  • $ pass rm Category/Site/User

How to view the git log for your pass store

  • $ pass git log

Notes

  • The above assumes an Ubuntu Linux system, so some things may be done for you automatically, like running a gpg supervisor in your current session the first time you unlock your gpg key.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment