riveryc / otp

OTP in command line

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OTP in command line

OTP is a simple cli tool that implemented in Golang to output the OTP code.

This project is using the lib from "github.com/creachadair/otp" as the HOTP (RFC 4226) and TOTP (RFC 6238) algorithms.

Build

mkdir bin
go build -o bin/otp ./cmd/otp

Usage

OTP help

cd bin
./otp --help
Usage: otp <command>

An OTP command tool

Flags:
      --help       Show context-sensitive help.
  -D, --debug      Enable debug mode
  -V, --verbose    Verbose mode.
  -v, --version    Print Version.

Commands:
  get    Get otp code.

Run "otp <command> --help" for more information on a command.

Get an otp code from secret

./otp get --secret <secret>

Pipe with openconnect VPN to automatic pass the MFA

# make sure to remove "<>" with following
echo "<your password>\n`otp get -s <secret>`" | sudo openconnect -u <your username> https://<your vpn url with port> --passwd-on-stdin

About

OTP in command line


Languages

Language:Go 100.0%