clusterssh (cssh) can pass options to ssh:

cssh -o "-o ConnectTimeout=1" myserver.mydomain.org

I am trying to pass ProxyCommand option to ssh, but it does not work. With plain ssh, I can use this:

ssh -o ProxyCommand='ssh root@ nc %h %p' behind-fw.mydomain.org

which will connect to server non-routable.mydomain.org via But when I try to use this with cssh:

cssh -o "-o ProxyCommand='ssh root@ nc %h %p'" non-routable.mydomain.org

I get this error:

Cannot open pipe for reading when talking to non-routable.mydomain.org : Interrupted system call

How can I pass ProxyCommand to cssh ?

  • Put it in your ssh_config instead? – muru Mar 26 at 6:23

If you want to pass whitespace within an option you need to see how quotes and double-quotes are handled by the perl script cssh. A simple way to do this is with the built-in debug option. At level 2 it will show you the xterm command that it is running. It is quite complex and includes an inline perl script that is enclosed in single quotes. Inside the script it sets a variable to a string enclosed in double quotes. So when you give an option like -o "-o 'x y'" what is being executed is:

xterm ... -e perl -e ' ... my $command="ssh -o 'x y'"; ... '

This breaks the perl script into 2 words, so will not work.

If you use double quotes in -o "-o \"x y\"", you get

... my $command="ssh -o "x y"";

This breaks the perl assignment, with x y being outside the string.

Finally, use single quotes and escaped double quotes, -o '-o \"x y\"', and it should work:

... my $command="ssh -o \"x y\"";

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.