A simple command line tool to generate TOTP(RFC 6238, aka Google Authenticator) based on mdp/rotp.
First, we should install dependencies, as always.
bundle install --without development
Then, create a .otp.yml
in your home folder (i.e. vim ~/.otp.yml
) like below:
otp:
google: YOUR_GOOGLE_AUTHENTICATOR_TOKEN_HERE
github: YOUR_GITHUB_AUTHENTICATOR_TOKEN_HERE
IMPORTANT!! Remember to set the file permissions to prevent other user from getting your secret token!
chmod 600 ~/.otp.yml
If you wish, create a symlink of main.rb
.
ln -s <THIS_REPO_DIR>/main.rb /usr/local/bin/otp
otp [-bc] SITE_NAME
SITE_NAME : Secret key identifier specified in .otp.yml . For the example above: google, github.
--base32 (-b) : Create a random Base32 string. No SITE_NAME needed.
--config (-c) : Specify a .otp.yml file. Default is ~/.otp.yml
Issues and pull requests are always welcome.