Giter Site home page Giter Site logo

ssh2-shell-server-examples's Introduction

SSH2 Shell Server Examples

Try out different types of shell servers.

To use any of these examples, you will need to generate host keys for the server.

To generate host keys in the examples directory in a unix-like environment:

# create a directory for our test keys
mkdir test_keys
cd test_keys
# generate the keys
ssh-kegen -f test_key -C ""

README Example

This is the source code shown in ssh2-shell-server's README

Connect to the server with an ssh client to recieve a message. The server will then terminate the connection.

Password Example

Authenticate with a shared secret.

Provide a method that verifies the user-provided username and password credentials before they can connect.

We provide an example checkPassword(username, password) to get you started. (The password is password)

Public Key Example

Authenticate with a public key.

To use this method, you must make your public key available as the environment variable $USER_PUBLIC_KEY.

Provide two methods to validate and verify public keys.

Validation takes in the user-provided username and raw public key and asserts that the server will accept it.

Verification takes in the username, a verifier determined by the user's key, and the signature provided by the user.

We provide an example implementation that validates and verifies the login based on process.env.USER_PUBLIC_KEY.

The Echo Shell

The password and public key examples rely on the shell defined in echo-shell.js to manage interactions with a connected client. The echo shell will 'echo' back anything sent to the server, as well as logging it locally.

ssh2-shell-server-examples's People

Contributors

kstafford3 avatar

Stargazers

Reuben avatar Valerio Santinelli avatar liqin avatar

Watchers

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