Forrest logo
back to the oathtool tool

oathtool:tldr:f7795

oathtool: Generate TOTP token (behaves like Google Authenticator).
$ oathtool --totp --base32 "${secret}"
try on your machine

This command is using the oathtool command-line tool to generate a Time-based One-Time Password (TOTP) value based on a given secret.

Here's the breakdown of each part:

  • oathtool: It is a command-line tool that calculates and displays the one-time password using the specified algorithm. It is commonly used for generating OTP values.
  • --totp: Specifies that the command should generate a Time-based OTP value.
  • --base32: Specifies that the secret provided is in base32 encoding. Base32 is a standard method of encoding binary data using alphanumeric characters.
  • "${secret}": This is a placeholder for the secret key needed to generate the OTP. It should be replaced with the actual secret key you want to use. The secret key is typically a shared secret between the generating system and the system verifying the OTP.

So, when you run this command, it will use the provided secret to generate a Time-based OTP value using the base32 encoding.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the oathtool tool