Giter VIP home page Giter VIP logo

sisyphus's Introduction

Sisyphus

帮助内网中的Raspberry Pi稳定保持ssh反向代理。

Why Sisyphus

Raspberry Pi可能处于家庭(或宿舍)等环境中,没有公网IP。

为了在其他环境中连接到Raspberry Pi,需要一台具有公网IP的电脑充当Server,为Raspberry Pi充当SSH反向代理。

PC <----> Server <----> Raspberry Pi

但SSH反向代理并不稳定,Server常常会丢失Raspberry Pi的连接。

为了让Raspberry Pi和Server之间保持较为稳定的连接,这里提供了一种定时检测连接状态并及时恢复的机制。

Sisyphus运行在Raspberry Pi上,Server只需开启ssh服务即可。

工作方式

每15分钟检查一次SSH反向代理是否正常,若不正常则重新设置SSH反向代理。保证Raspberry Pi可访问。

Requirement

Raspberry Pi:

  • Python3
  • pexpect

使用方法

首先将源代码clone到Raspberry Pi中:

git clone https://github.com/ex44559/Sisyphus

将cronfile中的目录更改为实际源代码的目录

将cronfile复制到/etc/crontab目录中:

cp <目录>/Sisyphus/cronfile /etc/crontab

重新启动cron服务(适用于CentOS 7 / Debian 8):

systemctl restart cron

修改sisyphus.py,将其中的100.100.100.100替换为Server的IP,将其中的haha替换为Server的密码即可。

其他

Sisyphus,即西西弗斯,一次又一次将巨石推上山顶。这个脚本也是一次又一次检查SSH连接。:)

sisyphus's People

Stargazers

Xiaobo avatar Xie.CS avatar

Watchers

James Cloos avatar BoSun avatar bfdyanshe avatar

Forkers

kevin-hans

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.