1

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

<user>@<host>

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

<user>@<samehost>:<onePort>
<user>@<samehost>:<anotherPort>
<user>@<samehost>:<yetAntherPort>

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

2 Answers 2

0

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

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

Host otherserver.net
    User root
    Port 5010

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

myserver
otherserver.net

Dsh should then work properly: dsh -a w

1
  • 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, 2015 at 4:23
0

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.

machines.pssh

localhost testuser
192.168.5.141:2317 quanta

then try something like this:

parallel-ssh -P -h machines.pssh w

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .