Giter VIP home page Giter VIP logo

openssh-stdinkey's Introduction

openssh-stdinkey

This project is a fork of OpenSSH which modifies the AuthorizedKeysCommand directive in sshd_config (present in OpenSSH 6.2 and above) such that the public key of the incoming connection is sent to standard input of the command, thus providing a means to identify the connecting user based solely on their public key and not by the username.

The inspiration for this project was to be able to provide a service similar to some popular version control repository hosting sites, where a user uploads their SSH public key(s) via a web interface and accesses their repositories over SSH using a common SSH user account like "git" or "hg". However, there are likely many other use cases for this project.

Branches

This git repository is organized into this branch (master), pristine OpenSSH branches (those that are just version numbers), and patched OpenSSH branches (those that end with -stdinkey). The master branch contains this README.md file and patches suitable for input to the patch command against a specific version of the OpenSSH source code.

Caveats

  • Warning: Specifying a command in AuthorizedKeysCommand that does not consume its standard input can lead to deadlock if this patch is applied. Specifically, sshd will write() all data (the incoming user's key) to standard input of the command before it attempts to read() any data from the command. If the incoming user's key is greater than the pipe buffer size then writing that data will block until what's in the pipe is consumed, but in this case there is no consumer.

    • If you must use a command that does not consume its standard input, then you should at least close standard input in a wrapper script:

      #!/bin/sh
      exec 0>&- # close stdin
      exec /usr/libexec/command-that-does-not-consume-stdin
      
  • It is probably a good idea to limit the use of the AuthorizedKeysCommand directive to the specific user which you would like to have this behavior using a Match block:

    Match user git
        AuthorizedKeysCommand /usr/libexec/lookup-ssh-key
    

openssh-stdinkey's People

Contributors

scottduckworth 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.