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 系统调度进程. 可以使 ...
随机推荐
- C_C++变量命名规则
变量命名规则是为了增强代码的可读性和容易维护性.以下为C++必须遵守的变量命名规则: 变量名只能是字母(A-Z,a-z)和数字(0-9)或者下划线(_)组成. 第一个字母必须是字母或者下划线开头. 不 ...
- Thinkpad L440 无线驱动突然无法使用,无法搜索到无线上网
问题描述: 环境:Thinkpad L440,不知道是什么版本的,找朋友买的,买的时候连系统都没有,自己装的Win7系统,驱动均为官方网站下载安装.电脑在使用过程中一直带着电池,连接电源使用. 问题: ...
- 如何使用LinkedHashMap来实现一个LruCache
最近在看mybatis的源代码,发现了mybatis中实现的LruCache使用到了LinkedHashMap,所以就探究了一下LinkedHashMap是如何支持Lru缓存的 LinkedHashM ...
- word2vec:基本的安装及使用简介
官方word2vec的github下载地址:https://github.com/svn2github/word2vec 环境,linux-ubuntu-14.04LST,安装好git, gcc版本4 ...
- TestNG 框架的运用
TestNG这个测试框架可以很好的和基于Selenium的web自动化测试结合在一起,实现把我们写好的自动化测试用例以自定义顺序执行.下面分为十二步来对TestNG测试框架进行总结,包括环境的部署,从 ...
- 寻求js
寻找登录的post地址 在form表单中寻找action对应的url地址 post的数据是input标签中的name值作为键,真正的用户名密码作为值得字典,post的url地址就是action对应的u ...
- windows服务安装 System.IO.FileLoadException
报错如下: System.IO.FileLoadException: 未能加载文件或程序集“file:///D:\WindowsService\bin\Debug\WindowsService.exe ...
- mui 滑块开关 进度条 以及如何获取值
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name ...
- thinkphp 多图片上传 单图片上传
不管是单图片上传还是多图片上传都必须要引用这两个js 下载地址 链接:http://pan.baidu.com/s/1eStkUt0 密码:asvo <script src="Publ ...
- FTPClient工具类
package com.vcredit.ddcash.server.commons.net; import com.vcredit.ddcash.server.commons.model.FtpPar ...