send remote command through paramiko via ssh.
attention: we assume that your command will surely be finished in limited time, and this program will output nothing before your command is done on the remote server.
- go https://github.com/GGN-2015/rexec/releases and download a
.whl
file. - use
pip install rexec-<version>-py3-none-any.whl
to install the package into your local environment.
pip install neko_rexec
you need to fill in six parameters in the following order, if you are not sure about the <port>
argument, try to let <port>
equal to 22
.
python3 -m neko_rexec <user> <host> <cmd> <password> <port>
if you have configured an auto login with ~/.ssh/authorized_keys
, you can just leave <password>
blank as follows:
python3 -m neko_rexec <user> <host> <cmd> "" <port>
here is a sample usage of this package, this will output a detailed list of file under the home folder of the user named "admin".
python3 -m neko_rexec "admin" "192.168.0.1" "cd ~; ls -alh" "1145141919810" 22