Giter Club home page Giter Club logo

a2fa's Introduction

a2fa

a2fa ("annoying two-factor authentication") is a command line tool for generating and validating one-time password.

Introduction

a2fa means annoying two-factor authentication. Its purpose is to get rid of phones and be able to authenticate easily. It keeps synced with Google Authenticator, Microsoft Authenticator.

Description:

  • An easy-to-use substitute for 2FA apps like TOTP Google authenticator.
  • Supports the OATH algorithms, such as TOTP and HOTP.
  • No need for network connection.
  • No need for phone.

Installation instructions

Linux

One-liner bash script to install a2fa

sudo -v ; curl https://raw.githubusercontent.com/csyezheng/a2fa/main/scripts/install.sh | sudo bash

macOS

One-liner bash script to install a2fa

sudo -v ; curl https://raw.githubusercontent.com/csyezheng/a2fa/main/scripts/install.sh | sudo bash

Windows

One-liner PowerShell script to install a2fa

Invoke-Expression "& { $(Invoke-RestMethod 'https://raw.githubusercontent.com/csyezheng/a2fa/main/scripts/install.ps1') }"

Manual installation and more

Please see the installation

Usage

a2fa [command] [flags] [args]
Available Commands:
  add         Add account and its secret key
  completion  Generate the autocompletion script for the specified shell
  generate    Generate one-time password from secret key
  help        Help about any command
  list        List all added accounts and password code
  remove      Remove account and its secret key
  update      Add account and its secret key
  version     show version
a2fa generate [flags] <secret key>
a2fa add [flags] <account name> <secret key>
a2fa remove [flags] <account name> <account name>...
a2fa update [flags] <account name> <secret key>
a2fa list [flags] [account name] [account name]...

Commonly used flags

Flags:
  -b, --base32         use base32 encoding of KEY instead of hex (default true)
  -c, --counter int    used for HOTP, A counter C, which counts the number of iterations
  -e, --epoch int      used for TOTP, epoch (T0) which is the Unix time from which to start counting time steps
  -H, --hash string    A cryptographic hash method H (default "SHA1")
  -h, --help           help for add
      --hotp           use event-based HOTP mode
  -i, --interval int   used for TOTP, an interval (Tx) which will be used to calculate the value of the counter CT (default 30)
  -l, --length int     A HOTP value length d (default 6)
      --totp           use use time-variant TOTP mode (default true)

Examples

Generate code

a2fa generate [flags] <secret key>

Examples:

a2fa generate ADOO3MCCCVO5AVD6

Output: Code: 488821

Show flags and usage:

a2fa generate -h

Add account

a2fa add [flags] <account name> <secret key>

Examples:

a2fa add GitHub ADOO3MCCCVO5AVD6

Output: account added successfully

Show flags and usage:

a2fa add -h

List acccount

a2fa list [flags] [account name] [account name]...

Examples:

a2fa list

Output:

0. GitHUb 414033
1. Google 337590
2. Microoft 54936
3. Apple 70362

Remove accounts

a2fa remove [flags] <account name> <account name>...

Examples:

a2fa remove GitHub

Output: accounts deleted successfully

Update acccount

a2fa update [flags] <account name> <secret key>

Examples:

a2fa update GitHub 5BRSSSBJUWBQBOXE

Output: account updated successfully

Show flags and usage:

a2fa update -h

Reporting issues

If you encounter any problems, you can open an issue in our bug tracker, please fill the issue template with as much information as possible.

Contributing

Refer to CONTRIBUTING.md

License

Apache License 2.0, see LICENSE.

a2fa's People

Contributors

csyezheng avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.