Skip to content
forked from poolpog/bash-otp

Command line 2FA. 2-Factor verification similar to Google Authenticator and Authy.

License

Notifications You must be signed in to change notification settings

tonluong/bash-otp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bash-otp

Command line 2FA. 2-Factor verification similar to Google Authenticator and Authy.

  • TOTP (Time-based One-Time Password) using oathtool
  • Encrypt / Decrypt using OpenSSL
  • Copies to clipboard using pbcopy (macOS); xclip (Linux)
  • Supports both encrypted and plain-text token files

Requirements

Setup

macOS

brew install oath-toolkit gawk

Linux

$ sudo aptitude install -y oathtool libpam-oath
$ sudo aptitude install -y xclip

Contents

  • otp - Read tokenfile and generate TOTP value
  • otp-lockfile - Encrypt tokenfile, remove original file and save new encrypted tokenfile in tokenfiles/ folder
  • otp-unlockfile - Decrypt tokenfile and save to plain-text file
  • /tokenfiles/ - Empty folder

Usage

otp

$ ./otp amazon		# reads tokenfiles/amazon[.enc]
Password:
29: 123456
59: 008256
10: 193842 

Paste value from clipboard

  • ⌘ Command + v
  • Ctrl + v

otp-lockfile

$ echo "1234 1234 1234" > tokenfiles/amazon

$ ./otp-lockfile tokenfiles/amazon
Password:
Verify Password: 

$ ls -l tokenfiles/

About

Command line 2FA. 2-Factor verification similar to Google Authenticator and Authy.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%