Access multiple Host in SSH node

I am trying to access multiple servers and run some commands using the SSH nodes.
Created a table that contains a list of servers’ IPs and their respective action and used expression in connecting host field.
But ssh node is able to access first records only.
Printing private IP only.
Output:
[

{

“code”: 0,

“signal”: null,

“stdout”: “10.20.07.79”,

“stderr”: “”

},

{

“code”: 0,

“signal”: null,

“stdout”: “10.20.07.79”,

“stderr”: “”

}

]
How can I achieve this?

You’ll need to use a Split in Batches node otherwise all items will use the same host/ip in credentials.

See Loop through hostnames and ssh each one - #5 by pemontto

2 Likes

I just tried this one, but the problem persist.
SSH into the first hostname all the times.
I have a list of 34 and I have 34 results from the command only executed on the first hostname.

Welcome to the community @gabrielpc1190 !

You would have to:

  1. Change “Batch Size” on the SplitInBatches node to 1
  2. Connect the output of “Google Sheets 1” node with the input of the SplitInBatches node to create a loop
1 Like

Nice! Thank you!
It worked perfectly fine!