Code Monkey home page Code Monkey logo

sshtunnel's Introduction

GitHub Org's stars

godoc oproxy.cn goreportcard.com deps.dev

watchers stars forks issues branches releases tags license GitHub go.mod Go version (subdirectory of monorepo) GitHub release (latest SemVer) GitHub tag (latest SemVer) GitHub pull requests GitHub issues GitHub code size in bytes GitHub language count GitHub search hit counter GitHub top language

sshtunnel

go语言实现的一个ssh端口映射的程序

使用二进制程序

可以自己下程序自行编译或去 https://github.com/zngw/sshtunnel/releases 下载已经编译好的对应版本

单端口映射使用

sshtunnel -l 127.0.0.1:3717:0.0.0.0:3717 -h ssh://root:[email protected]:22

说明

  • -l: 映射端口。127.0.0.1:3717 开启隧道的远程主机配置;0.0.0.0:3717 开启隧道映射到本地的配置
  • -h: ssh连接主机参数,uri格式
  • -p: 密钥文件,若是密码登录此项可忽略

使用配置文件

sshtunnel -c ./config.yaml

配置说明

配置文件为yaml格式,例如:

-
  # SSH连接配置,uri格式
  uri: ssh://[email protected]:22
  # 密钥文件,若是密码登录此项可忽略
  pkey: ./rsa.pem
  # 隧道转发配置
  tunnels:
    -
      # 开启隧道的远程主机配置,格式为【IP地址:端口】
      remote: 127.0.0.1:27017
      # 开启隧道映射到本地的配置,格式为【IP地址:端口】
      local: 0.0.0.0:27017
    -
      remote: 127.0.0.1:6379
      local: 0.0.0.0:6379
-
  # SSH连接配置,uri格式
  uri: ssh://root:[email protected]:22
  # 隧道转发配置
  tunnels:
    -
      # 开启隧道的远程主机配置,格式为【IP地址:端口】
      remote: 127.0.0.1:27017
      # 开启隧道映射到本地的配置,格式为【IP地址:端口】
      local: 0.0.0.0:27017

sshtunnel's People

Contributors

guoke3915 avatar zngw avatar

Stargazers

 avatar null avatar  avatar

Watchers

 avatar

Forkers

leetaifook fulldb

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.