Remote shell run through passball 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 remoteshell host side like normal ssh process.
Git clone passball(https://github.com/wangmarkqi/passball) 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 remoteshell in slave machine and run slave::slavedispatch::dispatch() in main.rs;
This step is for host side. Git clone remoteshell in host machine and run host::shell::runshell()
First specify slave id by "use
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