'Mobaxterm - Open bookmark in new tab and connect to list of servers stored in txt file

I have the need to connect to an SSH jump box server and then from there, SSH to another server and then issue commands. In this case, I need to issue the same exact commands to 188 servers.

Normal procedure for this:

  1. Connect to an SSH server that is a bookmark in Moba.
  2. Input ssh0 user@privateip
  3. Cry
  4. Go about my business
  5. Cry as I go to the next server

I am looking to script this so I can connect to a list of servers with the 'ssh0 user@privateip' from a txt file. The txt file is currently in the following format, but can be changed:

10.0.0.1
10.0.0.2
10.0.0.3
...
10.0.0.254

So ideally, I would like to execute a command where Moba would do the following:

  1. Open bookmark1 in new tab
  2. ssh0 [email protected]
  3. Open bookmark1 in new tab
  4. ssh0 [email protected]
  5. Open bookmark1 in new tab
  6. ssh0 [email protected]
  7. Repeat until it reaches the end of the txt file list

From there, I can use the MultiExec tool in Moba to issue the same commands simultaneously.

Would somebody please be so kind as to assist me with crafting a solution for this in Mobaxterm?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source