add otp with pass

This commit is contained in:
2025-12-04 17:48:15 +01:00
parent 42e46d0834
commit 5cb141942e
2 changed files with 49 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
---
title: "pass"
tags: [ "data" ]
tags: [ "data", "credentials", "secrets" ]
requires: "GPG Basics"
---

48
data/pass_otp.md Normal file
View File

@@ -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}"
```