If you have multiple servers and one server is logged on for management, it cannot be said, so the batch management tools have emerged. If you have set SSH password-less logon: ssh-keygen-trsassh-copy-iduser @ host distribute the key to the responding host
If you have multiple servers and one server is logged on for management, it cannot be said, so the batch management tools have emerged. If you have set SSH password-less logon:
ssh-keygen -t rsassh-copy-id user@host
By distributing the key to the responding host, you can achieve ssh login and operations without a password.
Pssh is written in Python. before running it, make sure that the Python environment is installed on the machine.
Use wget to download, compile, and install:
wget http://parallel-ssh.googlecode.com/files/pssh-2.3.1.tar.gz
Extract
tar xvf pssh-2.3.1.tar.gz
Install
python setup.py install
Introduction to pssh
-H: The list of remote hosts or-H user @ ip: port file content in the format of [user @] host [: port]-l remote machine username-p maximum number of connections allowed at a time-o output content redirected to a file-e execution error redirected to a file-t set command execution timeout- A prompts you to enter the password and pass it to ssh-O to set the specific configuration of ssh parameters, refer to the ssh_config configuration file-x to pass multiple SSH commands. Separate multiple commands with spaces, enclosed in quotation marks-X is the same as-x, but only one command can be passed at a time.-I indicates that standard output and standard errors are displayed. after each host is executed,-I reads each input command, and passed to the ssh process to allow the command script to be transmitted to the standard input.
The other command pscp in the package transfers files to multiple hosts. its features are similar to scp. pslurp copies files from multiple remote machines. pnuke kill the process of remote machines.