From 5cb141942e77c6d40731293c29f04069a0a99590 Mon Sep 17 00:00:00 2001 From: Malin Freeborn Date: Thu, 4 Dec 2025 17:48:15 +0100 Subject: [PATCH] add otp with pass --- data/pass.md | 2 +- data/pass_otp.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 data/pass_otp.md diff --git a/data/pass.md b/data/pass.md index 8aca8da..e3cdbf2 100644 --- a/data/pass.md +++ b/data/pass.md @@ -1,6 +1,6 @@ --- title: "pass" -tags: [ "data" ] +tags: [ "data", "credentials", "secrets" ] requires: "GPG Basics" --- diff --git a/data/pass_otp.md b/data/pass_otp.md new file mode 100644 index 0000000..c46f542 --- /dev/null +++ b/data/pass_otp.md @@ -0,0 +1,48 @@ +--- +title: "pass with otp" +tags: [ "data", "credentials", "secrets", "2fa", "otp" ] +requires: "pass" +--- + +Need a Microsoft or Google authenticator? +No you don't. + +These usually come in the form of QR codes. + + +```qr code + +                                  +    █▀▀▀▀▀█ ▀ ▀▀▀ ▀ ▄ █▀▀▀▀▀█     +    █ ███ █ ▄▄▀▄▄▀▄▄▀ █ ███ █     +    █ ▀▀▀ █ ██ ▀▄██▀▀ █ ▀▀▀ █     +    ▀▀▀▀▀▀▀ █ █▄▀ █ █ ▀▀▀▀▀▀▀     +    █▄▄ █▄▀▀██ ▄▄▀▀▄██▀▀██ ▄▀     +    ▄██▄▀█▀█ ▀▄▀ █▀▀▀█ ▀▀▀█▄      +    ▄ ▄▄█ ▀▀ ▄▄▀▀█▄█ ▀▀ ▄▀▀█▀     +      █ ▀ ▀▀█▀▀ ▄ ▄█▀▄▀██▀█▄      +    ▀▀▀ ▀ ▀ █▄▄▀▄▀▀▄█▀▀▀█▀▀       +    █▀▀▀▀▀█ ▀▄ █▀█▀ █ ▀ █▄▄       +    █ ███ █ ▀ ▄ ▀█▄ ████▀▀█▄█     +    █ ▀▀▀ █  ▄▀ ▄ ▄▄ ██▄▄█▄█      +    ▀▀▀▀▀▀▀ ▀ ▀▀ ▀▀▀ ▀▀   ▀▀▀     +                                  +                                  +``` + +Download the code, and get the information out: + + +```sh +zbarimg qr.png +otp="$(zbarimg qr.png | sed 's/QR-Code://')" +otp_name=site.org.otp +echo "${otp}" | pass otp add --echo "${otp_name}" +``` + +Show the OTP: + + +```sh +pass otp "${otp_name}" +```