User Tools

Site Tools


docu:chseet:ofsec:sec:otp_comand_line

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
docu:chseet:ofsec:sec:otp_comand_line [2020/05/21 10:18] – created admindocu:chseet:ofsec:sec:otp_comand_line [2020/08/17 09:34] (current) admin
Line 2: Line 2:
  
 \\ \\
 +It is surely really handy to be able to **generate TOTP codes** on the command line,
 +as it can be used either as a **secure client**, or by integrating it on a **custom service**.
 +
 +Instructions for **Debian-based** Linux's, (adapt it to your needs)
 +<code bash>
 +apt-get install oathtool
 +
 +# save the secrets somewhere
 +echo 'SECRET_FOR_AMAZON' > ~/.otp/amazon
 +echo 'SECRET_FOR_PROTONMAIL' > ~/.otp/proton
 +
 +# create the current time code by file output
 +cat ~/.otp/amazon | xargs oathtool --totp --base32
 +cat ~/.otp/proton | xargs oathtool --totp --base32
 +
 +# (optionally), you can copy directly to clipboard without cat'ing it
 +# by using the xclip tool (apt-get install xclip)
 +cat ~/.otp/proton | xargs oathtool --totp --base32 | xclip -rmlastnl -i /dev/stdin
 +
 +</code>
 +
 +\\
 +**Have a QR code on the screen** and don't know **how to copy** the secret value **manually**??
 +unless the **service gives you the ability** to copy the secret directly, you **won't be able** to do so.
 +
 +Follow the **other guide** i made about [[docu:csheet:dtproc:images:qr_code_parsing|QR code image handling]] so you can **save the secret for creating codes** on the command line later.
  
docu/chseet/ofsec/sec/otp_comand_line.1590056321.txt.gz · Last modified: 2020/05/21 10:18 by admin