Coder Social home page Coder Social logo

ssh-tunnel's Introduction

SSH Tunnel

GitHub GitHub Workflow Status GitHub go.mod Go version GitHub release (latest by date)

A tunneling tool based on ssh protocol can be used for port forwarding. No dependency and out of the box.

Features

  • support local,remote,dynamic ssh port forwarding
  • support ssh-key,password authentication method

Usage

./sshtunnel-macos-arm64
Usage of ./sshtunnel-macos-arm64:
  -config string
    	config file
  -v	show version information
  -verbose
    	verbose mode

Quick Start

At first, you need write a configuration like this:

{
  "target": "host:port",
  "username": "username",
  "private-key": "location of ssh private key",
  "passphrase": "private-key passphrase or password of username",
  "tunnels": [
    {
      "local": "127.0.0.1:13306",
      "remote": "172.16.0.14:3306",
      "mode": "local"
    },
    {
      "local": "127.0.0.1:8080",
      "remote": "0.0.0.0:18080",
      "mode": "remote"
    },
    {
      "local": "127.0.0.1:1080",
      "mode": "dynamic"
    }
  ]
}

and then, use the following command to start ssh tunnel:

./sshtunnel -config /path/to/config -verbose

after the tunnel is established:

connect to the remote MySQL service like connecting to the local:

mysql -h 127.0.0.1 -P 13306 -u root -p # in local

connect to local service in remote:

nc -l 8080 # in local
nc localhost 18080 # in remote

connect to dynamic addr using socks5 protocol via remote server:

curl -x socks5://localhost:1080 ip.sb # in local

LICENSE

MIT

ssh-tunnel's People

Contributors

c3b2a7 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

huffery

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.