Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Using dsh you can define the list of machines in ~/.dsh/machines.list in the form:


I'd like to have multiple hosts with different ssh ports, like this (I tried):


But dsh complains with a "Could not resolve hostname: user@samehost:onePort" for every line with the ":port".

I browsed the manual and there is no mention of "per line" port (there is just a global config), am I out of luck?

Thank you

share|improve this question
up vote 0 down vote accepted

You can actually create a ~/.ssh/config file to specify individual options (see man ssh for more options) for every host, eg:

Host myserver
    User someuser
    IdentityFile ~/.ssh/some_id
    IdentitiesOnly yes

    User root
    Port 5010

After creating that file you may modify your ~/.dsh/machines_list accordingly:


Dsh should then work properly: dsh -a w

share|improve this answer
I think this is a good workaround (even if I'd rather have everything in the dsh config file), since I have many ports on the same host (they are ssh tunnels to other hosts) the .ssh/config would become: Host tunneled1 Host server User root Port <PORT1> Host tunneled2 Host server User root Port <PORT2> ... Host tunneledN Host server User root Port <PORTN> – atrent Jul 5 '15 at 4:23

dsh (dancer's shell): is it possible to specify ports in config file?

As far as I have tried, I'm afraid that the answer is: No.

Use pssh instead.


localhost testuser quanta

then try something like this:

parallel-ssh -P -h machines.pssh w
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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