2017-09-05 59 views
0

在没有采用IPS工作,我有一个文本文件,如:的pdsh文件

cat hed.txt 
10.21.23.12 
10.23.12.12 

我可以ssh到每个IP无无提示输入密钥验证。

我想在这些IP上运行一个命令,所以我使用的是pdsh。我试过多种选择,但我得到以下错误:

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 
[email protected]: 00f12e86-cfcc-4239-9dfc-006b65a319c3: ssh exited with exit code 255 

我提到here,我试过以下为好,但这也给了同样的错误。

PDSH_SSH_ARGS_APPEND="-o StrictHostKeyChecking=no" pdsh -R ssh -w ^hed uptime 

也试过从here评论,但没有帮助。

PDSH_SSH_ARGS_APPEND="-o StrictHostKeyChecking=no" pdsh -R ssh ^hed uptime 
[email protected]: no remote hosts specified 

我能够通过做这些csshx:csshX --host hed.txt,它的作品,但pdsh将满足更多对我的工作,这是行不通的。

+0

也许尝试设置env变量'export PDSH_RCMD_TYPE = ssh' ... –

+0

@ l'L'l这也给'ssh退出退出代码255' – Saurabh

回答

0

啊,这个工作就像这样:

pdsh -w '^hed.txt' uptime 

对于我的同事是工作没有引号也有相同版本的pdsh,这是奇怪的。

相关问题