p2pssh

module
v0.0.0-...-3fb6a18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2019 License: GPL-3.0

README

p2pssh

p2pssh is based on libp2p which is easily to connect to other machines, whether or not there is a public IP

build

go get .
./build.sh

usage (Documentation is not yet complet)

wany@WANY:~/go/src/github.com/wanyvic/p2pssh$ ./p2pssh help
A Distributed Secure Shell

Usage:
  p2pssh [flags]
  p2pssh [command]

Available Commands:
  connect     A brief description of your command
  daemon      A brief description of your command
  help        Help about any command
  login       A brief description of your command
  ping        A brief description of your command

Flags:
      --config string      config file (default is $HOME/.p2pssh.yaml)
  -h, --help               help for p2pssh
  -l, --log-level string   Set the logging level ("debug"|"info"|"warn"|"error"|"fatal") (default "info")

Use "p2pssh [command] --help" for more information about a command.

1. set p2pssh deamon

p2pssh must have a deamon process to link another peer

It is a daemon process
wany@WANY:~/go/src/github.com/wanyvic/p2pssh$ ./p2pssh daemon
Your PeerID is :Qmb3Tn7SPGxXn7ENagQUY9mVwhNqhr8Ac4C9mWiDqrrbST
Listen:[/ip4/127.0.0.1/udp/9000/quic /ip4/192.168.0.133/udp/9000/quic /ip4/172.17.0.1/udp/9000/quic]

2. In another computer,start a daemon process and try to ping this peer

wany@WANY:~/go/src/github.com/wanyvic/p2pssh$ ./p2pssh ping Qmb3Tn7SPGxXn7ENagQUY9mVwhNqhr8Ac4C9mWiDqrrbST
ping took: 35.50429ms
ping took: 33.223504ms
ping took: 34.923255ms
ping took: 33.357161ms
ping took: 38.924518ms
ping took: 34.280522ms
ping took: 32.667023ms
ping took: 34.534543ms

3. login it

wany@WANY:~/go/src/github.com/wanyvic/p2pssh$ ./p2pssh login wany@Qmb3Tn7SPGxXn7ENagQUY9mVwhNqhr8Ac4C9mWiDqrrbST
Password:  //input your password
wany02@WANY02:~$

4.list connections

wany@WANY:~/go/src/github.com/wanyvic/p2pssh$ ./p2pssh connect ls
QmdQERFyHXZE4mBUuSrjbcuicRrmrQk4BB6uTAfiFWWjvq

5. connect one peer

./p2pssh connect add /ip4/119.3.66.159/udp/9000/quic/p2p/QmdQERFyHXZE4mBUuSrjbcuicRrmrQk4BB6uTAfiFWWjvq
Connected successfully

6. remove one peer

wany@WANY:~/go/src/github.com/wanyvic/p2pssh$ ./p2pssh connect rm QmdQERFyHXZE4mBUuSrjbcuicRrmrQk4BB6uTAfiFWWjvq
Connection Disconnect successfully

Directories

Path Synopsis
cmd
p2p

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL