---
name: "pdsh-ssh"
section: "1"
platform: "linux"
package: "pdsh"
version: "1.7-6-8"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/pdsh-ssh"
---

# pdsh-ssh(1)

issue commands to groups of hosts in parallel

." $Id: pdsh.1.in,v 1.17 2002/09/27 14:28:03 grondo Exp $

## NAME

pdsh - issue commands to groups of hosts in parallel

## SYNOPSIS

**pdsh** *\[-options\] command*

## DESCRIPTION

**pdsh** is a variant of the [rsh(1)](/rsh/1.md) command.  Unlike [rsh(1)](/rsh/1.md) which runs commands on a single remote host, [pdsh(1)](/pdsh/1.md) can run multiple remote commands in parallel. Options are described in TARGET NODE LIST OPTIONS and OTHER OPTIONS below.

When pdsh receives SIGINT (ctrl-C), it lists the status of current threads. A second SIGINT within one second terminates the program.

The DSHPATH environment variable, if set, will be the PATH for the remote shell.

If a command is not specified on the command line,  **pdsh** runs interactively, prompting for commands and executing them when terminated with a carriage return.  In interactive mode, target nodes that  time out on the first command are not contacted for subsequent commands, and commands prefaced with an exclamation point will be executed on the local  system.

## TARGET NODE LIST OPTIONS

*-w host,host,...* Target the specified hosts.  No spaces are allowed in the comma-separated list.  A list consisting of a single "-" character causes the target  hosts to be read from stdin, one per line.  The host list may contain  hostname ranges of the form \`\`host\[1-5\]''. For more information about hostname ranges, see the HOST RANGES section below.

*-x host,host,...* Exclude the specified hosts.  May be specified in conjunction with other target node list options such as -a. Hostname ranges may also be specified to the -x option (see HOST RANGES section below)

*-a* Target "all" nodes in the cluster. *-g attribute* Target nodes that have the specified genders attribute.

*-i* In conjunction with -a or -g, request canonical hostnames. The default is to use reliable hostnames.

If none of the above options are specified, the WCOLL environment variable must point to a file that contains a list of nodes, one per line.

## OTHER OPTIONS

*-q* List option values and the target nodes and exit without action.

*-f number* Set the maximum number of simultaneous remote commands.  The default is  32.

*-s* Combine remote command stderr with stdout.  Combining these saves one socket per connection, but breaks remote cleanup when  **pdsh** is interrupted with a ctrl-C. NOTE: this option has the reverse meaning on AIX where remote cleanup works without the extra socket.

*-l user* This option may be used to run remote comands as another user, subject to authorization.  For BSD rcmd, this means the invoking user and system must be listed in the user´s .rhosts file (even for root).

*-t seconds* Set the connect timeout.  Default is 10 seconds.   (This is concurrent with the normal socket-level timeout).

*-u seconds* Put a limit on the amount of time a remote command is allowed to execute. Default is no limit.

*-n tasks\_per\_node* Set the number of tasks spawned per node.  The underlying remote shell service must support spawning multiple tasks for this to be effective.

*-d* Include more complete thread status when SIGINT is received, and display connect and command time statistics on stderr when done.

*-S* Return largest of the remote command return values.

## HOST RANGES

As noted in sections above,  **pdsh** accepts ranges of hostnames in the general form: prefix\[n-m,l-k,...\], where n \< m and l \< k, etc., as an alternative to explicit lists of hosts.  This form should not be confused with regular expression character classes (also denoted by \`\`\[\]''). For example, foo\[19\] does not represent foo1 or foo9, but rather represents a degenerate range: foo19.

This range syntax is meant only as a convenience on clusters with a prefixNN naming convention and specification of ranges should not be considered necessary -- the list foo1,foo9 could be specified as such, or by the range foo\[1,9\].

Some examples of range usage follow:

Run command on foo01,foo02,...,foo05\
     pdsh -w foo\[01-05\] command

Run command on foo7,foo9,foo10\
     pdsh -w foo\[7,9-10\] command

Run command on foo0,foo4,foo5\
     pdsh -w foo\[0-5\] -x foo\[1-3\] command

## ORIGIN

Originally a rewrite of IBM [dsh(1)](/dsh/1.md) by Jim Garlick \<garlick@llnl.gov\> on LLNL's ASCI Blue-Pacific IBM SP system.   It is now also used on Linux clusters at LLNL.

## LIMITATIONS

This copy of pdsh has been configured to use **ssh** which causes the stderr of ssh to be folded in with that of the remote  command.  When invoked by pdsh, it is not possible for ssh to prompt for  confirmation if a host key changes, prompt for passwords if RSA keys are not  configured properly, etc..  Finally, the connect timeout is not adjustable  when ssh is used.

Host range parsing assumes numerical part of hostname is at the end, e.g. specifying foo\[0-5\]bar will not work.

## FILES

/usr/bin/ssh\
\
 /usr/bin/nodeattr\
\

## SEE ALSO

[rsh(1)](/rsh/1.md), [ssh(1)](/ssh/1.md), [dshbak(1)](/dshbak/1.md), [pdcp(1)](/pdcp/1.md)
