Scroll to navigation

GENOTPURL(1) General Commands Manual GENOTPURL(1)


genotpurlGenerate Google Authenticator URLs


genotpurl -I issuer -L label [-k key] [-K keylen] [-i] [-c counter] [-d num-digits] [-p period]


genotpurl is a utility for generating URLs for the Google Authenticator cell phone app, which generates one-time passwords compatible with the HOTP/OATH algorithm defined by RFC 4226. When an URL is processed by the Google Authenticator app, the corresponding secure token is automatically installed into the app.

The issuer and label are required; these strings are displayed in the app along with the current token value.

The key is the token's binary secret key and is specified as a hexadecimal string. If no key is given, genotpurl generates a random key and prints it to standard error; this key must then be installed into the server application that verifies the one-time passwords and associated with the user who will be using the secure token.

The -i, -c, -d, and -p flags allow creation of non-standard tokens, but these may not be supported by Google Authenticator.


Specify the starting target counter value for the one-time password generation. This flag is incompatible with the -t flag.
Specify the number of digits in the one-time password. The default value is six.
Print the usage message and exit successfully.
Specify token issuer (e.g., "Example Industries, Inc.")
Create an interval-based token instead of a time-based token.
Specify the token binary secret key as a hexadecimal string.

If no key is given, genotpurl generates a random key and prints it to standard output.

Specify generated key length. Ignored if -k is also specified.
Specify token label (e.g., "")
Specify the length of a single time interval in seconds. The default value is 30 seconds. Ignored if -i is given.


To generate a new secure token and generate the corresponding QR code:

genotpurl -I "Acme, Inc" -L | qrencode -s 6 -o qrcode.png



mod_authn_otp: Apache module for one-time password authentication,

Google Authenticator (iOS),

Google Authenticator (Android),


Archie L. Cobbs ⟨⟩

July 21, 2018 Linux 6.4.0-150600.23.7-default