Non-interactive remote execute command script under Linux (better than SSH)
OpenSSH are on every machine, and SSH and SCP often appear in our lives.
However, when the size of the machines to be managed is growing, it becomes impractical to manage the SSH landing to the target machine.
Although the command can be executed directly behind the SSH command. But the strict authorization of SSH allows us to enter a password, or establish a trust relationship, it is difficult to customize a specific authentication method.
This deficiency is based on SSH. So I wrote a Jetfire, this tool. One of the more important features than SSH is the ability to customize the authentication method and avoid a potential bug in SSH.
The bug is like this. For example, suppose the target machine is example.com
[Python]
SSH example.com echo "Hello World"
Execute this command, see the output, not
[Python]
Hello World
But
[Python]
Hello World
The guess is that SSH translates the echo "Hello World" command into a string and executes it with BASH-C. While writing the Jetfire, the problem was repaired by the way.
The use of Jetfire is also very simple.
Jetfire-h example.com command is on the back.
Eg:jetfire-h example.com echo Hi Boy
For multiple machines, the method is also simple jetfire-h example1.com,example2.com echo Hi Boy
The execution results are like this.
If we write a list of machines into a file, such as Host.list, combined with the Xargs command, we can write a more advanced approach
Cat Host.list | Xargs-r-i{} jetfire-h {} echo Hi boy
Installation is also very simple, download https://github.com/shxsun/jetfire/blob/master/jetfire0.9-arm64.tar.gz, decompression, switch to Root,sh install.sh even if installed on the /etc/init.d/jetfirectl start starts the service process.