pssh批量ssh操作
# wget http://files.opstool.com/files/pssh-2.3.tar.gz
# tar zxfv pssh-2.3.tar.gz
# cd pssh-2.3
# python setup.py install
使用:
# pssh -A -h server.txt 'shutdown' (如果設定了免密碼登入就不用-A)
# pssh -A -h server.txt 'service httpd stop;service mysql stop' (多個指令中間用“;”隔開)
server.txt裡寫多個伺服器名即可
pscp批量分發檔案:
# pscp -h server.txt /root/sh/aa /root/
從一堆伺服器中拷貝檔案到中心伺服器:
# pslurp -h server.txt /etc/hosts /root/
本文轉自linux部落格51CTO部落格,原文連結http://blog.51cto.com/yangzhiming/1737927如需轉載請自行聯系原作者
yangzhimingg