Giter Club home page Giter Club logo

oath-ssh-command's Introduction

oath-ssh-command

Think of this as authy-ssh but for OATH [TH]OTP.
So it works:

  • offline (when you’re cut of from the net but not from the machine you’re ssh:ing into)
  • without sending any authentication request to an external service.

Currently the only OATH PAM module supported is Google Authenticator PAM module
but others are planned (when they arrive). See also WONTFIX

It also supports using the OTP_TOKEN environment variable for your
token so it can be used with e.g. mosh:

$ export OTP_TOKEN=1337
$ mosh example.com
$

Installation

  1. Build the code:
    $ make
  2. Put the somewhere you want it to be, /usr/local/bin/ is nice.
  3. In your ~/.ssh/authorized_keys add:
    command="/usr/local/bin/oath-ssh-command" ssh-rsa AAAAZOMGLOL[…]== awesome key with OTP
  4. ssh into your machine with that key:
    $ ssh awesome-machine
    Verification code: 1337
    $

WONTFIX

  • Since pam_oath uses one file per server which is owned by root we can’t support that (because it would force us to setuid or otherwise run as root).

TODO

  • Add tests for:
    • multiple keys and OTP-tokens in an hash
  • Fix FIXME’s in the code
  • Use IsBase32Secret instead of base32.StdEncoding.DecodeString
  • Support HOTP
  • Support these features from Google Authenticator PAM module:
    • Support for emergency scratch codes
    • Protection against replay attacks
    • HOTP

oath-ssh-command's People

Contributors

simmel avatar

Watchers

James Cloos avatar  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.