Motang的网络日志

目录

介绍

PSSH provides parallel versions of OpenSSH and related tools. Included are pssh, pscp, prsync, pnuke, and pslurp. The project includes psshlib which can be used within custom applications.

The source code is written in Python and can be cloned from: https://github.com/robinbowes/pssh.git

PSSH is supported on Python 2.4 and greater (including Python 3.1 and greater). It was originally written and maintained by Brent N. Chun. Due to his busy schedule, Brent handed over maintenance to Andrew McNabb in October 2009.

下载安装

https://github.com/robinbowes/pssh/archive/master.zip

> unzip master.zip
> cd pssh-master
> python setup.py install

参数命令介绍

介绍pssh参数 pssh 在多个主机上并行地运行命令

   -h 执行命令的远程主机列表  或者 -H user@ip:port  文件内容格式[user@]host[:port]
   -l 远程机器的用户名
   -P 执行时输出执行信息
   -p 一次最大允许多少连接
   -o 输出内容重定向到一个文件
   -e 执行错误重定向到一个文件
   -t 设置命令执行的超时时间
   -A 提示输入密码并且把密码传递给ssh
   -O 设置ssh参数的具体配置,参照ssh_config配置文件
   -x 传递多个SSH 命令,多个命令用空格分开,用引号括起来
   -X 同-x 但是一次只能传递一个命令
   -i 显示标准输出和标准错误在每台host执行完毕后

其他命令

pscp     传输文件到多个hosts,类似scp
pslurp   从多台远程机器拷贝文件到本地
pnuke    并行在远程主机杀进程
prsync   使用rsync协议从本地计算机同步到远程主机

实例

pssh -H nginx@192.168.1.102:9000 -P date

© 2015 Morly Tang. All Rights Reserved.

版权归属:寂寞的男人