Giter Club home page Giter Club logo

rancher-template-ssh-tunnel's Introduction

SSH Tunnel

This stacks deploys an SSH tunnel service.

Whitelisting services

By default, the SSH service forbids tunneling to all services. In order to whitelist a service, you must add an ssh_tunnel.port label to it, with the port you wish to allow.

For example, if you deploy:

version: '2'
services:
   hello:
     image: tutum/hello-world
     labels:
       ssh_tunnel.port: '80'

to a stack named foo, the SSH tunnel service will allow tunneling to hello.foo:80, as well as foo-hello-1:80 (and foo-hello-2... if you scale the service).

Using the tunnel

It might be useful to setup an SSH client configuration for your tunnel in ~/.ssh/config, e.g.:

Host infra-tunnel
  HostName tunnel.ssh.<env_domain>
  Port 2222
  LocalForward 8080 hello.raphink:80
  LocalForward 8081 raphink-hello-1:80
  LocalForward 8082 raphink-hello-2:80
  User tunnel

where <env_domain> is the external DNS domain for the Rancher environment you deployed to.

Then don't forget to pass the -N flag to ssh (Do not execute a remote command. This is useful for just forwarding ports.): ssh -v -N infra-tunnel curl http://localhost:8080

rancher-template-ssh-tunnel's People

Contributors

raphink avatar

Watchers

Frédéric Junod avatar Christian Kaenzig avatar Vincent Renaville avatar James Cloos avatar Alexandre Fayolle avatar Maurer Luc avatar  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.