Find the OTP pin in your terminal

I have alway an opened terminal in front of my eyes, rarely my phone, so I found helpful to retrieve my OTP pin with a bash command

# yum install oathtool

the secret can be find in the home of your user:

$ cat ~/.2fa.secret

then you can create a bash file with this, think to chmod 700 <file>


/usr/bin/oathtool --totp <hexKey>