linux命令之pssh命令
查看一下pssh命令的帮助文档:
[root@test2 ~]# pssh --version
2.3.
[root@test2 ~]# pssh --help
Usage: pssh [OPTIONS] command [...] Options:
--version show program's version number and exit
--help show this help message and exit
-h HOST_FILE, --hosts=HOST_FILE
hosts file (each line "[user@]host[:port]")
-H HOST_STRING, --host=HOST_STRING
additional host entries ("[user@]host[:port]")
-l USER, --user=USER username (OPTIONAL)
-p PAR, --par=PAR max number of parallel threads (OPTIONAL)
-o OUTDIR, --outdir=OUTDIR
output directory for stdout files (OPTIONAL)
-e ERRDIR, --errdir=ERRDIR
output directory for stderr files (OPTIONAL)
-t TIMEOUT, --timeout=TIMEOUT
timeout (secs) ( = no timeout) per host (OPTIONAL)
-O OPTION, --option=OPTION
SSH option (OPTIONAL)
-v, --verbose turn on warning and diagnostic messages (OPTIONAL)
-A, --askpass Ask for a password (OPTIONAL)
-x ARGS, --extra-args=ARGS
Extra command-line arguments, with processing for
spaces, quotes, and backslashes
-X ARG, --extra-arg=ARG
Extra command-line argument
-i, --inline inline aggregated output and error for each server
--inline-stdout inline standard output for each server
-I, --send-input read from standard input and send as input to ssh
-P, --print print output as we get it Example: pssh -h hosts.txt -l irb2 -o /tmp/foo uptime
-h:参数指定主机的文件,主机文件格式如下:
[root@test2 ~]# cat ip.test
root@10.0.102.162
root@10.0.102.212
root@10.0.102.200
-A: 交互输入密码, -i命令,上面的解释不太清楚,测试如下:
[root@test2 ~]# pssh -h ip.test -A -i w
Warning: do not enter your password if anyone else has superuser
privileges or access to your account.
Password:
[] :: [SUCCESS] root@10.0.102.212
:: up days, :, users, load average: 0.08, 0.03, 0.05
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root tty1 12Feb19 15days .01s .01s -bash
root pts/ 172.16.100.19 Tue08 :38m : .13s -bash
[] :: [SUCCESS] root@10.0.102.200
:: up days, min, users, load average: 0.00, 0.01, 0.05
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root tty1 11Feb19 17days .01s .01s -bash
root pts/ 172.16.100.19 Wed15 :00m .03s .03s -bash
[] :: [SUCCESS] root@10.0.102.162
:: up days, min, users, load average: 0.00, 0.01, 0.05
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root tty1 11Feb19 16days .07s .07s -bash
root pts/ 172.16.100.19 Wed15 :00m .05s .05s -bash
[root@test2 ~]# pssh -h ip.test -A w
Warning: do not enter your password if anyone else has superuser
privileges or access to your account.
Password:
[] :: [SUCCESS] root@10.0.102.212
[] :: [SUCCESS] root@10.0.102.162
[] :: [SUCCESS] root@10.0.102.200
批量修改密码:
#把root密码修改为 123456
[root@docker5 ~]# pssh -h ip.test -A "echo root:123456 | chpasswd"
Warning: do not enter your password if anyone else has superuser
privileges or access to your account.
Password:
[] :: [SUCCESS] root@10.0.102.200
[] :: [SUCCESS] root@10.0.102.212
[] :: [SUCCESS] root@10.0.102.162
pscp.pssh命令与pslurp命令,一个把本地文件传送到远程主机,一个是把远程主机文件垃下来。
[root@docker5 ~]# pscp.pssh --help
Usage: pscp.pssh [OPTIONS] local remote
[root@docker5 ~]# pscp.pssh -h ip.test roles.tar.gz /usr/local/src/
[] :: [SUCCESS] root@10.0.102.212
[] :: [SUCCESS] root@10.0.102.200
[] :: [SUCCESS] root@10.0.102.162
pnuke kill远程机器的进程
linux命令之pssh命令的更多相关文章
- 转载:Linux批量远程管理主机命令_pssh用法详解
原文:http://www.linuxidc.com/Linux/2011-12/49635p2.htm (一) 使用前提 中心主机连接远程主机可以通过ssh密钥无密码连接 (二) 命令格式 pssh ...
- 2-1 Linux 操作系统及常用命令
根据马哥linux初级视频 2-1.2-2来编辑 1. GUI与CLI GUI: Graphic User Interface CLI: Command Line Interface 注:在Windo ...
- Linux上的free命令详解、swap机制
Linux上的free命令详解 解释一下Linux上free命令的输出. 下面是free的运行结果,一共有4行.为了方便说明,我加上了列号.这样可以把free的输出看成一个二维数组FO(Free ...
- Linux查看系统状态命令
Linux查看系统状态命令 iostat iostat 命令详细地显示了存储子系统方面的情况.你通常用iostat来监控存储子系统总体上运行状况如何,并且在用户注意到服务器运行缓慢之前提早 ...
- windows 环境和linux环境下 ping命令的区别:
Ping 是Windows自带的一个DOS命令.利用它可以检查网络是否能够连通,用好它可以很好地帮助我们分析判定网络故障.该命令可以加许多参数使用,键入Ping按回车即可看到详细说明.Ping 命令可 ...
- linux全方位掌握一个命令--思路比方法更重要
Linux命令众多,当不清楚一个命令的使用方法时,我们该怎样了解命令的属性和帮助? 1.用type命令了解一个命令的属性 [root@zejin240 testdir]# type cd cd ...
- Linux 硬盘分区生效命令partprobe
在Linux中使用fdisk命令进行分区时,有时会遇到"WARNING: Re-reading the partition table failed with error 16: Devic ...
- linux 文件系统结构及命令
1.linux 文件系统结构 / 根目录 root |--mnt/ | |--sdcard/ 挂载点 | |--usb0 | |--cdrom |--home | |--soft01 <- 用 ...
- Linux 设置定时任务crontab命令
1. crontab命令概念 crontab命令用于设置周期性被执行的指令.该命令从标准输入设备读取指令,并将其存放于“crontab”文件中,以供之后读取和执行. cron 系统调度进程. 可以使 ...
随机推荐
- IDEA破解教程
IDEA目前堪称最完美的java开发工具,相信用惯了eclipse的朋友一定不这么认为,但是这并不是终点,终点是如何安装破解版的IDEA,官网给我们的两个下载:1.免费试用:2.免费.开源.作为一名程 ...
- Apache kylin进阶——元数据篇
一.Apache kylin元数据的存储 Apache kylin的元数据包括 立方体描述(cube description),立方体实例(cube instances)项目(project).作业( ...
- centos 安装python PIL模块
转载:https://www.cnblogs.com/ccdc/p/4069112.html 1.安装 使用yum安装缺少类库: #尤其重要,否则会报错 yum install python-deve ...
- codechef cook 103 div2
第一次打codechef...不太会用这oj. A: #include <bits/stdc++.h> #define mk(a,b) make_pair(a,b) #define pii ...
- php框架中,try,catch不能用的问题(转载)
本文转自:http://blog.csdn.net/sangjinchao/article/details/71436557 最近再用laravel框架发现,try catch用了没有效果,依然不能阻 ...
- HashSet的底层
今天看博客,发现有个哥哥写到 HashSet的底层是数组结构,有点懵逼,不是HashMap吗怎么成数组了? 遂去查了下源码: 得以下结论: HashSet底层是 HashMap,其元素是内部map的k ...
- org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'root'@'localhost' (using password:
tationProcessor' to allow for resolving potential circular referencesDEBUG 2018-05-28 11:32:35,016 o ...
- InnoDB中锁的算法(1)
Ⅰ.InnoDB锁算法的介绍 首先明确一点,锁锁住的是什么?锁锁住的是索引 Record Lock 单个行记录上的锁 Gap Lock 锁定一个范围,但不包含记录本身 Next-key Lock Ga ...
- jQuery 实现点击页面其他地方隐藏菜单
点击页面其它地方隐藏id为messageList的div 代码: $('body').delegate("#message", 'click', function(e) { var ...
- windows 控制台下运行cl命令
前提:确保已经安装vc6或者vs系列 我们可以再命令行直接编译c++程序, 在windows操作系统中,打开命令行,输入cl,若系统提示:'cl' 不是内部或外部命令,也不是可运行的程序或批处理文件. ...