Giter Site home page Giter Site logo

docker-dropbear-rfwd's Introduction

docker-dropbear-rfwd

Docker Cloud Build Status

Small container with minimal dropbear-ssh-server for remote tcp forwarding. Designed for accessing services behind NAT with attention to security of jump server. Dropbear building from sources with minimal configuartion supports only remote tcp forwarding and auth by pubkey.

Build

git clone https://github.com/rokiden/docker-dropbear-rfwd.git
cd docker-dropbear-rfwd
docker build . -t rokiden/dropbear-rfwd

Usage

On jump server:

  • expose ssh port
  • bind /keys volume with authorized_keys and dropbear_ecdsa_host_key (automatically created if not exists)
  • (option) expose forwarded service port
  • (option) set UUID env used for authorized_keys permissions fix (default 1000)
  • (option) pass dropbear args (-K 10)
docker run -d --name dropbear-rfwd -p4444:22 -p4422:2000 -v /opt/dropbear-rfwd/keys:/keys -e UUID=1111 rokiden/dropbear-rfwd -K 10

On remote server (behind NAT):

forward remote ssh to jump server

ssh -p4444 -N -R 0.0.0.0:2000:localhost:22 -o ServerAliveInterval=10 [email protected]

or persistent forwarding with cron and autossh

@reboot bash -c "while :; do autossh -M 10000 -p4444 -N -R 0.0.0.0:2000:localhost:22 -o ServerAliveInterval=10 [email protected]; sleep 5; done" >> /var/log/autossh.log 2>&1

Tunnel usage:

After successfull connection, container listen forwarded port 2000 (optionally jump server listen container exposed 4422).

On jump server (172.17.0.3 is container ip)

ssh -p2000 [email protected]

or from desktop if 4422 exposed

ssh -p4422 [email protected]

docker-dropbear-rfwd's People

Contributors

rokiden avatar

Forkers

malsingmapmas

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.