2 ms·
for the curious: function 2fa(){ local sec=$(pass show $1.secret) local code=$(oathtool -b --totp "$sec") echo $code | xsel -i
by jvanderbot 4y ago
for the curious:
function 2fa(){
local sec=$(pass show $1.secret)
local code=$(oathtool -b --totp "$sec")
echo $code | xsel -ib
echo "Copied $code"
}
then call it as `2fa <account>`, and make sure you store each <account>'s secret as `pass insert <account>.secret -e`.
refs: https://www.cyberciti.biz/faq/use-oathtool-linux-command-line-for-2-step-verification-2fa/ https://www.cyberciti.biz/faq/use-oathtool-linux-command-lin...