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 <[email protected]>
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 [email protected], 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 [email protected]
Password store initialized for [email protected]
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.