4 ms·
I store my TOTP secrets in the Gnome Keyring totp() { TOKEN=$(keyring get totp $1) oathtool -b --totp $TOKEN | xclip } and my TOTP
by markuman123 3y ago
I store my TOTP secrets in the Gnome Keyring
totp() {
TOKEN=$(keyring get totp $1)
oathtool -b --totp $TOKEN | xclip
}
and my TOTP secrets are saved via ansible-vault
- name: set TOTP in keyring
with_items: "{{ TOTP }}"
community.general.keyring:
service: totp
username: "{{ item }}"
password: "{{ TOTP[item] }}"
keyring_password: "{{ keyring_password }}"
- teddyh 3y agoBeware: That shell function will use the secret on a command line, leaking the secret to the process list, available to every user on the system. The oathtool manual page even warns about this. I would instead recommend something like: totp() { oathtool --base32 --totp -- @<(keyring get totp "$1") | xclip } (Bash required.)