This is a rollup of the above information as I used it for pass
with gpg2
on Kubuntu 20.04 (Ubuntu Linux v 20.04 with KDE desktop)
pass
is the Linux CLI password manager.
High Level View:
pass
requires that you have a public gpg
key. gpg
is a Linux CLI encryption program. There are several versions. Kubuntu 20.04 uses gpg2
but just calls it "gpg".
You will first have to create a gpg
key. Then you pass the key-id to pass
as an argument. After which it should work.
Generate the key:
~$ gpg --gen-key
Have a look at your shiny new key:
~$ gpg --list-keys
pub rsa3072 2022-07-17 [SC] [expires: 2024-07-16]
YourKey (a bunch of letters and numbers)
uid [trust-level] yourName <yourAddress@email.com>
sub rsa3072 2022-07-17 [E] [expires: 2024-07-16]
You have to tell your machine to trust your new key:
gpg --edit-key yourName yourAddress@email.com, trust, 5, save)
(this step actually wasn't necessary for me, because the trust was automatically set to [ultimate] - but doing this step didn't hurt me.)
From this point forward you can move forward with the pass
page at:
https://www.passwordstore.org/
------ this is what it looked like for me setting up a password for docker in a folder called 'dev' -------------------
Initialize the password store:
~$ pass init yourAddress@email.com
Password store initialized for yourAddress@email.com
Create the password store:
~$ pass insert dev/docker
mkdir: created directory '/home/$USER/.password-store/dev'
Enter password for dev/docker:
Retype password for dev/docker:
Did I enter the correct password? -
~$ pass dev/docker
thisIsTheWrongPassword!
Remove the wrong password -
~$ pass rm dev/docker
Are you sure you would like to delete dev/docker? [y/N] y
removed '/home/$USER/.password-store/dev/docker.gpg'
Enter the correct password
~$ pass insert dev/docker
mkdir: created directory '/home/$USER/.password-store/dev'
Enter password for dev/docker:
Retype password for dev/docker:
Check if password is correct second time-
~$ pass dev/docker
doNotExposeYourPasswordOnStackExchange!
I can use pass to login to Docker Hub via CLI
pass dev/docker | login -u myUserName --password-stdin
This pipes the password directly to Docker Hub without printing it to screen.
gpg --generate-key
– ItayB Jun 19 '17 at 05:43gpg --gen-key
(in gpg 1.4.20) – MonkeyDreamzzz Jul 13 '18 at 08:17gpg
(version 1.4.20) under Xubuntu, leads always to failures (generating passwords viapass
). Usinggpg2
(version 2.1.11) made everything work fine. – Nikos Alexandris May 09 '19 at 23:34gpg -k
– John Mee May 15 '19 at 23:44gpg: foo: skipped: No public key
: https://unix.stackexchange.com/questions/676444/gpg-error-retrieving-email-via-wkd-no-data-when-trying-credential-storage – iago Nov 06 '21 at 15:39