Pssh轻量自动化工具
https://code.google.com/archive/p/parallel-ssh/downloads
主机列表
[root@localhost ~]# cat ip.txt
192.168.1.225
[root@localhost ~]#
做过免密登录
> 拷贝文件
[root@localhost ~]# pscp -h ip.txt /etc/hosts /etc/hosts
[1] 14:03:00 [SUCCESS] 192.168.1.225
[root@localhost ~]#
>获取进程状态
[root@localhost ~]# pssh -H 192.168.1.225 getenforce
[1] 14:06:00 [SUCCESS] 192.168.1.225
[root@localhost ~]# pssh -H 192.168.1.225 date
[1] 14:06:18 [SUCCESS] 192.168.1.225
[root@localhost ~]# pssh -H 192.168.1.225 docker
[1] 14:13:17 [SUCCESS] 192.168.1.225
[root@localhost ~]#
未配置免密
[root@localhost ~]# pssh -A -h ip.txt -l zhangp -i 'date'
Warning: do not enter your password if anyone else has superuser
privileges or access to your account.
Password:
[1] 14:00:03 [SUCCESS] 192.168.1.225
2020年 11月 11日 星期三 14:00:03 CST
[root@localhost ~]#