Non-interactive remote execute command script under Linux

Source: Internet
Author: User
Tags ssh ssh example

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.