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 系统调度进程. 可以使 ...
随机推荐
- BackboneJS 源码注释
Backbone 作者在源码中做了很好的注释,这里只是锦上添花,补充一些个人的理解而已. // Backbone.js 1.2.3 // (c) 2010-2015 Jeremy Ashkenas, ...
- linux系统搜索文件中关键字的位置
grep -Irn “ubuntu”-------即查出文件的目录路径
- 121、Data Binding(数据绑定)(转载)
http://www.jianshu.com/p/b1df61a4df77 http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2015/060 ...
- Linux 的基本操作(文件与目录管理)
文件与目录管理 在linux中什么是一个文件的路径呢,说白了就是这个文件存在的地方,例如在上一章提到的/root/.ssh/authorized_keys 这就是一个文件的路径.如果你告诉系统这个文件 ...
- python 字符类型
1.整型 int 短整型在window中是2**30--2**39 长整型 long 在python中不区分长短 2.浮点数 float 一般是小数 3.复数 4.boolen类型(布尔类型) 运算结 ...
- Python idle运行代码出现'ascii' codec can't encode characters in position 0-2
编码问题,采用一种方法: Python代码 ,开头加: import sys reload(sys) sys.setdefaultencoding('utf8') 在idle中运行后没错误,但是不显示 ...
- day4_局部变量和全局变量
一.介绍: 定义在函数内部的变量拥有一个局部作用域,定义在函数外的拥有全局作用域. 局部变量意思就是在局部生效的,出了这个变量的作用域,这个变量就失效了 全局变量的意思就是在整个程序里面都生效的,在程 ...
- vue 安装cli3.0版本,创建项目
注意:Vue CLI需要Node.js版本8.9或更高版本(建议使用8.11.0+). 查看node版本:node -v , 查看npm 版本 npm -v, 1.首先需要安装node.js环境 ...
- 15.3-uC/OS-III资源管理(多值信号量)
多值信号量是 uC/OS 操作系统的一个内核对象, 主要用于标志事件的发生和共享资源管理. 1.如果想要使用多值信号量,就必须事先使能多值信号量. 多值信号量的使能位于“os_cfg.h”. 2.OS ...
- 构造方法 this super
1 构造方法 1.1 构造方法Constructor概述创建对象要明确属性值,此时需要用到构造方法,即对象创建时要执行的方法,用来给对象的属性进行初始化.在new对象时,知道其执行的构造方法是什么,就 ...