pdsh@frin: localhost: rcmd: socket: Permission denied

首先,检查pdsh的Rcmd type配置:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
$ pdsh -q -w localhost
-- DSH-specific options --
Separate stderr/stdout Yes
Path prepended to cmd none
Appended to cmd none
Command: none
Full program pathname /usr/bin/pdsh
Remote program path /usr/bin/pdsh

-- Generic options --
Local username zhangjc
Local uid 1000
Remote username zhangjc
Rcmd type rsh


one ^C will kill pdsh No
Connect timeout (secs) 10
Command timeout (secs) 0
Fanout 32
Display hostname labels Yes
Debugging No

-- Target nodes --
localhost

从配置项中可以看到Rcmd type为rsh,应该配置为ssh。在 .bashrc 中添加环境变量:

1
export PDSH_RCMD_TYPE=ssh

重新加载 .bashrc后问题解决:

1
$ source ~/.bashrc