Giter VIP home page Giter VIP logo

proxyssh's Introduction

proxyssh

CI Status

A golang package based on https://github.com/gliderlabs/ssh that enables easily creating different ssh servers. Also includes Docker support.

Use Cases

The main use case of this package is to provide a simple interface to build an ssh server that runs commands on the host it is running on. See the cmd/simplesshd package.

A secondary use case is to provide an ssh server that runs commands in matching docker containers. See the cmd/dockersshd package.

A third use case of this package is to provide an ssh server that provides no shell access, but permits port forwarding only. See the cmd/exposshed package.

For a more detailed overall documentation, see the godoc.

Tests

This package comes with a tests suite as well as a builtin memory-leak detector. The tests can be run as any normal go test suite can:

go test ./...

Some tests require docker-compose and /bin/bash to be installed on the local machine. They furthermore require a network connection to download the alpine docker image during tests. These special tests are not run by default, but only when the dockertests tag is provided. To run these tests, use:

go test -tags=dockertest ./...

The memory leak detector is not enabled by default and not used during the tests. By default, all code calling the memory leak detector is removed during compilation.

The detector can be enabled by adding the leak go build tag. When enabled, all executables output memory leak messages for every connection to the console.

Dockerfiles

This repository contains Dockerfiles for all of the examples, called cmd/${example}/Dockerfile.

These are available as the GitHub Packages dockersshd, simplesshd and exposshed respectively.

The dockersshd image can be run as follows:

docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -p 2222:2222 ghcr.io/tkw1536/dockersshd:latest

To e.g. allow clients to expose port 8080 the exposshed image can be run as follows

docker run -t -v /path/to/hostkeys:/data/ -i --rm -p 2222:localhost:2222 -p 8080:8080 ghcr.io/tkw1536/exposshed:latest -R 0.0.0.0:8080

proxyssh's People

Contributors

tkw1536 avatar dependabot[bot] avatar

Watchers

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