我有一个文本文件,像这样:
cat hed.txt
10.21.23.12
10.23.12.12我可以在不提示密钥验证的情况下对每个ip进行ssh。
我想在每个IP上运行一个命令,所以我使用了帕什。我尝试了多个选项,但是我得到了以下错误:
pdsh -w ^hed uptime
00f12e86-cfcc-4239-9dfc-006b65a319c3: ssh: Could not resolve hostname 00f12e86-cfcc-4239-9dfc-006b65a319c3: nodename nor servname provided, or not known
pdsh@saurabh: 00f12e86-cfcc-4239-9dfc-006b65a319c3: ssh exited with exit code 255我提到了这里,我也尝试了跟踪,但这也给出了同样的错误。
PDSH_SSH_ARGS_APPEND="-o StrictHostKeyChecking=no" pdsh -R ssh -w ^hed uptime也尝试过来自这里的评论,但没有帮助。
PDSH_SSH_ARGS_APPEND="-o StrictHostKeyChecking=no" pdsh -R ssh ^hed uptime
pdsh@saurabh: no remote hosts specified我能够在这些via:csshX --host hed.txt上做csshx,它可以工作,但是pdsh将更适合于我的工作不起作用的工作。
发布于 2017-09-06 16:31:22
啊,这样起作用了,
pdsh -w '^hed.txt' uptime对于我的同事来说,它是在没有引号的情况下工作,同样的pdsh版本也是如此,这是很奇怪的。
https://stackoverflow.com/questions/46046326
复制相似问题