Installing Polysh
wget http://guichaz.free.fr/polysh/files/polysh-0.4.tar.gztar -zxvf polysh-0.4.tar.gzcd polysh-0.4sudo python setup.py install
Using Polysh
Usage:/usr/bin/polysh [OPTIONS] HOSTS ... Control commands is prefixed by ":". Use:help for the list Options: --version Show Program ' s version number and exit -H,--help show this help message and exit --hosts-file=file read hostnames from given file, one per line --command=cmd command to execute on the remote shells --SSH=SSH SSH command to use [exec ssh-ologlevel=quiet-t % (host) s EXEC Bash--noprofile] --user=user remote user to log in as --no-color Disable colored hostnames [enabled] --password-file=file read a password from the specified file. -Is the TTY. --log-file=log_file file to log all machine conversation [None] --abort-errors Abort If some shell fails to initialize [ignore] --debug Print debugging information |
Create a host list file host.list, each of which behaves as a hostname or IP:
localhost Localhost.localdomain Localhost4 Localhost4.localdomain4 Node0003.nemongo.com |
Execution: Polysh--user=root--hosts-file=host.list, when all connections OK, will prompt a ready (5) >, here the number is the number of host.
650) this.width=650; "title=" clipboard "style=" border-top:0px; border-right:0px; border-bottom:0px; border-left:0px; Display:inline "border=" 0 "alt=" clipboard "src=" http://s3.51cto.com/wyfs02/M02/6C/CB/wKioL1VStWnyA7-xAAGNP9ZB7_ E290.jpg "" 795 "height=" 146 "/>
Note: If you do not want to enter a password before logging in, you can pre-configure SSH login without password.
To make it easy to run commands automatically in bulk using shell scripts, you can add parameter--command to specify which commands to execute:
650) this.width=650; "title=" clipboard[1] "style=" border-top:0px; border-right:0px; border-bottom:0px; border-left:0px; Display:inline "border=" 0 "alt=" clipboard[1] "src=" http://s3.51cto.com/wyfs02/M00/6C/CB/ Wkiol1vstwurkdn1aafz65jlhsm946.jpg "" 795 "height=" 113 "/>
Polysh Bulk execution of shell commands