Giter VIP home page Giter VIP logo

rssh's Introduction

RSSH

Reverse SSH gateway. SSH into any host in a private network by installing an agent that will maintain a reverse SSH session on a public server.

diagram

Quickstart

  1. Start the RSSH API & Gatekeeper
git clone https://github.com/Xide/rssh.git
cd rssh
docker-compose up --build
  1. Register your subdomain
go build

# baguette.localhost is the default specified in `.rssh.yml`
# It will register 127.0.0.1:22 by default. If
# you wish to expose another host, you can use
# the `--host` and `--port` arguments
./rssh agent register -d subdomain.baguette.localhost

>> 2019-02-10T03:39:43+01:00 INF Register new endpoint Host=127.0.0.1 Port=22 domain=subdomain.baguette.localhost
>> 2019-02-10T03:39:43+01:00 INF Persisted credentials to disk. domain=subdomain.baguette.localhost

./rssh agent ls

>> |-----------------------------------------------------------------------------|
>> | Domain                               | UID                                  |
>> |-----------------------------------------------------------------------------|
>> | subdomain.baguette.localhost         | a6ea341f-9b6d-413f-82be-da0ba214c831 |
>> |-----------------------------------------------------------------------------|

# Start to expose all the registered domains so far

./rssh agent

>> 2019-02-10T03:48:11+01:00 INF Starting RSSH agent. root-dir=/home/billy/.rssh
2019-02-10T03:48:11+01:00 INF Finished hosts import. hosts_count=1
>> 2019-02-10T03:48:11+01:00 INF Established forwarding. domain=subdomain.baguette.localhost host=127.0.0.1 port=22
  1. Connect through RSSH
cat >> ~/.ssh/config << EOF
Host *.baguette.localhost
    ProxyCommand ssh -p 2223 127.0.0.1 %h

EOF

ssh subdomain.baguette.localhost
  1. Cleanup
# Remove subdomain identity from agent known hosts
./rssh agent rm subdomain.baguette.localhost

>> 2019-02-11T15:56:31+01:00 INF Identity removed

# Two down to force volumes deletion
docker-compose down; docker-compose down;

Configuration

See .rssh.yml

Environment variables

You can use override any default and configuration sourced variable with the environment. All environment variables are prefixed with RSSH_, and their name is constructed by taking the capitalized dot separated path of your variable in .rssh.yml. (e.g: gatekeeper.ssh_port_range => RSSH_GATEKEEPER_SSH_PORT_RANGE)

TODO

Agent:

  • Reconnect on hangup
  • Runtime config synchronization
  • Proper resources garbage collection
  • New commands :
    • list identities
    • remove identities
  • daemon

Gatekeeper:

  • HostsKey file

API:

  • HTTPS

Global:

  • More logging
  • Proper README
  • Guides
  • CI/CD
  • Multiple API's / Gatekeepers
  • Agent multi OS compatibility
  • bash / zsh completions
  • Etcd authentication

rssh's People

Contributors

aslafy-z avatar xide avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rssh's Issues

start gatekeeper error

` ./rssh-windows.exe gatekeeper
2022-08-06T15:23:08+08:00 INF Starting Gatekeeper addr=0.0.0.0 port=2223 port-range=31240-65535
panic: interface conversion: error is *errors.errorString, not client.Error

goroutine 1 [running]:
github.com/Xide/rssh/pkg/gatekeeper.(*GateKeeper).WithEtcdE(0xc00019d1f0, 0xc00026eaa0, 0x1, 0x1, 0xb, 0xc00019a370)
E:/golab/rssh/pkg/gatekeeper/gatekeeper.go:69 +0x259
github.com/Xide/rssh/cmd/gatekeeper.NewCommand.func2(0xc0001a7680, 0x13aecc0, 0x0, 0x0, 0x0, 0x0)
E:/golab/rssh/cmd/gatekeeper/gatekeeper.go:88 +0x1ac
github.com/spf13/cobra.(*Command).execute(0xc0001a7680, 0x13aecc0, 0x0, 0x0, 0xc0001a7680, 0x13aecc0)
C:/Users/vincent/go/pkg/mod/github.com/spf13/[email protected]/command.go:762 +0x472
github.com/spf13/cobra.(*Command).ExecuteC(0xc0001a6500, 0xc0001a6500, 0x2, 0xc0000dbf48)
C:/Users/vincent/go/pkg/mod/github.com/spf13/[email protected]/command.go:852 +0x308
github.com/spf13/cobra.(*Command).Execute(...)
C:/Users/vincent/go/pkg/mod/github.com/spf13/[email protected]/command.go:800
github.com/Xide/rssh/cmd.Execute()
E:/golab/rssh/cmd/rssh.go:146 +0x1b8
main.main()
E:/golab/rssh/main.go:8 +0x27
`

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.