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 系统调度进程. 可以使 ...
随机推荐
- Qt编写自定义控件插件开放动态库dll使用(永久免费)
这套控件陆陆续续完善了四年多,目前共133个控件,除了十几个控件参考网友开源的代码写的,其余全部原创,在发布之初就有打算将动态库开放出来永久免费使用,在控件比较完善的今天抽了半天时间编译了多个qt版本 ...
- Scala函数使用可变参数
scala同java一样,在定义函数的时候支持接收可变长参数列表,即最后一个参数的可以被重复.示例代码如下: 结果: 在此代码中我们定义函数printInfo接收变长参数列表,其最后一个参数names ...
- C++对windows控制面板的操作
经常碰到程序无法卸载, 就老是骂微软搞的什么安装方式,安装好了不能卸载. 后来就打算研究一下windows是如何卸载程序的,一个程序安装完后留下了什么信息用于后面的卸载. 研究对象win7 64位, ...
- 在node环境使用axios发送文件
yarn add form-data (async () => { const l = console.log; const axios = require("axios") ...
- mac 初次配置apache,及mac下安装mysql
先打开apache,在浏览器上输入 localhost 回车后会如果屏幕上显示:It works! 如下图: 这说明你的apache已开启 mac 下apache配置(mac自带apache ...
- 严重: A child container failed during start的问题解决方法
找到tomcat中的server.xml中的文件, 将图中阴影的部分注释掉,即可.
- FTPClient工具类
package com.vcredit.ddcash.server.commons.net; import com.vcredit.ddcash.server.commons.model.FtpPar ...
- nessus无法访问https://localhost:8834/#/,解决方法。
之前没弄明白为啥经常访问不了https://localhost:8834/#/,后面才发现是服务关闭了. 首先netstat -an 查看8834是否开启, 直接运行一下nessus目录下的nessu ...
- Elasticsearch学习笔记(二)Search API 与 Query DSL
一. Search API eg: GET /mall/product/_search?q=name:productName&sort=price desc 特点:search的请求参数都是以 ...
- spss缺失值填充步骤
缺失值填充是数据预处理最基本的步骤,一般能想到的是固定值填充(均值等统计学方法).根据与本列有相关关系的列函数表示来填充.这次我用的是em算法进行填充,具体原理后续补充. 主要记录一下步骤: 工具栏: ...