博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
linux命令之pssh命令
阅读量:4654 次
发布时间:2019-06-09

本文共 3799 字,大约阅读时间需要 12 分钟。

查看一下pssh命令的帮助文档:

[root@test2 ~]# pssh --version2.3.1[root@test2 ~]# pssh --helpUsage: 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) (0 = 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 itExample: pssh -h hosts.txt -l irb2 -o /tmp/foo uptime

-h:参数指定主机的文件,主机文件格式如下:

[root@test2 ~]# cat ip.test root@10.0.102.162root@10.0.102.212root@10.0.102.200

-A: 交互输入密码, -i命令,上面的解释不太清楚,测试如下:

[root@test2 ~]# pssh -h ip.test -A -i wWarning: do not enter your password if anyone else has superuserprivileges or access to your account.Password: [1] 17:55:21 [SUCCESS] root@10.0.102.212 16:41:42 up 15 days, 19:20,  2 users,  load average: 0.08, 0.03, 0.05USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHATroot     tty1                      12Feb19 15days  0.01s  0.01s -bashroot     pts/0    172.16.100.19    Tue08    1:38m  6:13   0.13s -bash[2] 17:55:21 [SUCCESS] root@10.0.102.200 16:41:46 up 17 days, 9 min,  2 users,  load average: 0.00, 0.01, 0.05USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHATroot     tty1                      11Feb19 17days  0.01s  0.01s -bashroot     pts/0    172.16.100.19    Wed15    1:00m  0.03s  0.03s -bash[3] 17:55:21 [SUCCESS] root@10.0.102.162 16:41:45 up 17 days, 8 min,  2 users,  load average: 0.00, 0.01, 0.05USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHATroot     tty1                      11Feb19 16days  0.07s  0.07s -bashroot     pts/0    172.16.100.19    Wed15    1:00m  0.05s  0.05s -bash[root@test2 ~]# pssh -h ip.test -A  wWarning: do not enter your password if anyone else has superuserprivileges or access to your account.Password: [1] 17:55:29 [SUCCESS] root@10.0.102.212[2] 17:55:30 [SUCCESS] root@10.0.102.162[3] 17:55:30 [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 superuserprivileges or access to your account.Password: [1] 16:47:48 [SUCCESS] root@10.0.102.200[2] 16:47:48 [SUCCESS] root@10.0.102.212[3] 16:47:48 [SUCCESS] root@10.0.102.162

pscp.pssh命令与pslurp命令,一个把本地文件传送到远程主机,一个是把远程主机文件垃下来。

[root@docker5 ~]# pscp.pssh --helpUsage: pscp.pssh [OPTIONS] local remote[root@docker5 ~]# pscp.pssh -h ip.test roles.tar.gz /usr/local/src/[1] 16:50:45 [SUCCESS] root@10.0.102.212[2] 16:50:46 [SUCCESS] root@10.0.102.200[3] 16:50:46 [SUCCESS] root@10.0.102.162

pnuke    kill远程机器的进程

 

转载于:https://www.cnblogs.com/wxzhe/p/10452112.html

你可能感兴趣的文章
shu_1548 悟空问题(大哥,主妖怪抓走的朋友!)
查看>>
工作日志2014-08-19
查看>>
配置Log4j(非常具体)
查看>>
Spring4.0MVC学习资料,ApplicationContext中的方法具体解释(三)
查看>>
用JSP实现的商城购物车模块
查看>>
移动网络优化
查看>>
iis打开.apk等格式文件
查看>>
主线程——main线程
查看>>
jquery 画板折叠
查看>>
WordPress 如何搜索文章内容而不搜索页面
查看>>
Exchange2010 在win2008 r2安装先决条件
查看>>
使用 TOP 限制更新的数据
查看>>
LiveScript 函数
查看>>
「Sqlserver」数据分析师有理由爱Sqlserver之十-Sqlserver自动化篇
查看>>
网页前后端交互示例
查看>>
颜色列表
查看>>
jquery-2 jQuery原理和核心方法(多看学习视频)
查看>>
html5--3.17 新增的表单重写
查看>>
微信小程序 view中后台拿到的文本数据不换行
查看>>
UVALive 7503 Change(乱搞)题解
查看>>