Skip to content

suutaku/sshx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SSHX

Build Status

ssh p2p tunneling service. An enhanced version of https://github.com/nobonobo/ssh-p2p.git.

Connection sequence

ssh ---dial---> sshx client
sshx client <----negotiation----> sshx server
sshd <--dial--- sshx server

Backend protocol

Server is not stable, just for testing. Please use your own signaling server on production.

Install

Signaling server

go get -u github.com/suutaku/sshx/cmd/signaling

SSHX

go get -u github.com/suutaku/sshx/cmd/sshx

Configuration

Configure file will created at first time at path: $HOME/.sshx_config.json. Default configure as below:

{
  "fullnode": true,
  "id": "dd88229c-ad13-4210-a1ad-3d59f12e0655",
  "key": "78633077-3df7-4885-83f0-ef4361a4252f",
  "locallistenaddr": "127.0.0.1:2222",
  "localsshaddr": "127.0.0.1:22",
  "rtcconf": {
    "iceservers": [
      {
        "urls": [
          "stun:stun.l.google.com:19302"
        ]
      }
    ]
  },
  "signalingserveraddr": "http://peer1.cotnetwork.com:8990"
}
  • fullnode: set to false, node will runing only as a client,set to true, node will runing as both server and client.
  • locallistenaddr : sshx listen address.
  • localsshaddr: server sshd listen address.
  • rtcconf: STUN server configure.
  • signalingserveraddr: signaling server address.

Usage

  • Signaling server Specify server listening port by environment variable PORT, default 8080.
export SSHX_SIGNALING_PORT=[port you want] #default port is 8080
signaling
  • SSHX

Start sshx:

sshx -d

Connect to target device with devie ID:

sshx -t [your target device id] # tell sshx deamon target id
ssh -p 2222 [user]@127.0.0.1 # connect sshx deamon