From 2e0f2852d177cbed7ab450ff45ac6db8ad074b57 Mon Sep 17 00:00:00 2001 From: Peng Li Date: Fri, 22 Jun 2018 17:46:37 +0800 Subject: [PATCH] Rename file and add readme --- README.md | 35 +++++++++++++++++++++++++++++++++++ suanzi-support | 4 ---- mqtt-client.py => sztool | 0 3 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 README.md rename mqtt-client.py => sztool (100%) mode change 100644 => 100755 diff --git a/README.md b/README.md new file mode 100644 index 0000000..c13cdde --- /dev/null +++ b/README.md @@ -0,0 +1,35 @@ + +1. suanzi-support: a MQTT client, is a daemon running on remote embedded devices for remote debugging through ssh +2. sztool : a local tool, help to get the forwarding port to be used to connect to remote device + +## Install +- On embedded device + - run `./install.sh` to install the daemon and service file + - run `./add-user.sh` to create a user, used for remote ssh, named debug, and its password is hard2guess + +## Usage +To connect to remote embedded device, your should know the device's MAC address. + +1. run `./sztool -i 2acdeb93b285` + +where `2acdeb93b285` is the MAC address of rpdzkj board, which you want to +connect. + +2. If it succeed, it will return the forwarding port on `autossh.suanzi.ai` + +here is a sample +``` +debian@[~/project/remote-ssh]>> ./sztool -i 2acdeb93b285 +Connected with result code 0 +2acdeb93b285-response 32171 +port is 32171 +run ssh debug@autossh.suanzi.ai -p 32171 to connect to 2acdeb93b285 device +``` + +3. run `ssh debug@autossh.suanzi.ai -p 32171`, then you can ssh to remote + device. The password is 'hard2guess', create in file `add-user.sh` + + +## Note +- After the port is generated, the ssh session alive time is 5 min (defined by ALIVE_TIME in suanzi-support). +It means after you get the forwarding port, but not run ssh to connect in 5 minutes. this ssh session will terminate. diff --git a/suanzi-support b/suanzi-support index 183f6de..367f379 100755 --- a/suanzi-support +++ b/suanzi-support @@ -1,9 +1,5 @@ #!/usr/bin/env python2 -# dependencies: -# 1. pip install paho-mqtt -# 2. apt-get install sshpass -# from subprocess import call, Popen, PIPE, STDOUT import paho.mqtt.client as mqtt import shlex diff --git a/mqtt-client.py b/sztool old mode 100644 new mode 100755 similarity index 100% rename from mqtt-client.py rename to sztool -- 2.11.0