Code Monkey home page Code Monkey logo

ssh_reverse_proxy's Introduction

For connection between machines without public ip address, but have access to internet.

A(no public ip address) -> B(public ip address) <- C(no public ip address)

A <---ssh reverse proxy---> C

Usage

clone this repo to A machine, and run

./ssh_nopasswd B_user@B_ip_address

to make sure two server can be connected without password

run

./ssh_open_remote_port B_user@B_ip_address

or

apt install autossh #or install autossh it by yourself
./ssh_open_remote_port_keep_alive B_user@B_ip_address

to add crontab line to keep the service open

Result

B opens a new public ssh port, default 9999; for C, use this cmd to login A:

ssh -p 9999 A_user@B_ip_address

Params

sshd service of A must be open at the default 22 port or you need change environment variable as follows:

LOCAL_PORT=22 REMOTE_PORT=9999 ./ssh_open_remote_port B_user@B_ip_address
  • this script use -R and -N option of ssh binary, other ssh options are supported, for example:
./ssh_open_remote_port -p 123 B_user@B_ip_address

A ---LOCAL_PORT 22----> B <--ssh option(-p 123)----- C

A <------------REMOTE_PORT 9999(through B)-----------C

Ref

ssh_reverse_proxy's People

Contributors

zyp001a avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

patrick-mota

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.