Setting up pass on a new machine
I have been using pass
as a password manager since 2017. Pass is free and has an iOS client which I use on my iPhone. It’s worked well over the years but occasionally I need to set it up on a new machine. Because this rarely happens I am going to document the setup process here. This article is intended for people who already have pass
setup on one laptop and want to configure it on a new laptop.
# Install pass on new machine
brew install pass
# Add SSH public key for new laptop to git hosting provider:
ssh-keygen -b 4096 -t rsa -C newlaptop -f newkey
pbcopy < newkey.pub
# Paste the key into Settings on your git hosting
# Clone password repo to the new machine:
git clone git@host:repo.git .password-store
# On the old machine, export existing keys and transfer to new machine:
gpg --export ID > public.key
gpg --export-secret-keys ID > private.key
scp public.key private.key user@newmachine
# Import the keys on the new machine
gpg --import public.key && gpg --import private.key
You should now be able to list and view the values of existing passwords. You can also pass git pull
and pass git push
to sync your password store to the cloud.
Key expired #
If you get an error while adding or editing entries encryption failed: Unusable public key
, your GPG key may have expired. To extend expiration date
# Locate the expired key id
gpg --list-keys
# Enter edit mode
gpg --edit-key [key-id]
# At the prompt
> expire
> 12m
> quit
This will extend the expiration date on your GPG key by an additional 12 months.