Crates.io | remote_shell |
lib.rs | remote_shell |
version | 2.0.0 |
source | src |
created_at | 2020-06-10 02:27:30.970818 |
updated_at | 2020-11-30 08:46:32.824998 |
description | remote shell written by rust. |
homepage | https://github.com/wangmarkqi/remote_shell.git |
repository | https://github.com/wangmarkqi/remote_shell.git |
max_upload_size | |
id | 252183 |
size | 129,013 |
Remote shell run through pass_ball written by rust. The use scenarios include iot device with no fixed ip, home computer behind local network, etc. with remote shell client side installed on slave machine, you can access from remote_shell host side like normal ssh process.
Git clone pass_ball(https://github.com/wangmarkqi/pass_ball) and run main.rs in server with public ip or any place accessible. Revise conf string in .env :
SLAVE_ID = yourid
PASS_URL = http://192.168.177.1:8084
SLAVEID is id for slave, the slave only response for request which specified by 'use' command.
SLAVEID should not conflict with topics in pass msg queue,better use uuid as SLAVEID or any string you can sure will not duplicate.
To use remote shell, 2 kinds of binary are needed to be build, the salve and the host. This step is for slave side. Git clone remote_shell in slave machine and run slave::slave_dispatch::dispatch() in main.rs;
This step is for host side. Git clone remote_shell in host machine and run host::shell::run_shell()
First specify slave id by "use <slave id which from step 2>" and send command as normal shell,like "cd /home" etc.
You may find the common used key like del,arrow left,arrow right not working ,because remote_shell rewrite the terminal from raw mode. The shell operational keys include:
Back to last cmd input.
Go to next cmd input.
Delete input char before.
Complement input cmd based on history inputs.
Clear Terminal.
Quit the shell.
Besides standard commands,for example ls,pwd in linux or dir in win10, remote_shell provides building commands.
This command will specify the slave you want to control.You should run step3 on slave pc and config the slave id in the .env file. This salve_id (use arg) should be same with id in the .env file.
example: use remote
Send local file to remote. only small file works.
example: send C://test.txt /home/test.txt
Receive file from remote. only small file works.
example: rec C://test1.txt /home/test2.txt
Will restart remote computer.This command is sent by async message pub channel and act as the final rescue when shell crash. Pay attention to restart remote_shell automatically after system reboot.
example: restart