Skip to content
Advertisement

possible to script to open multiple terminals in local machine and ssh to different servers?

This is what I’d like to do:
On my local linux system (Ubuntu), I’d like to write a script which would open multiple terminals, and do an ssh to different servers (the list of servers would be in a text file which the script will read), and execute a program on each of those servers. Is this possible to do?

So far, I’ve got a script which will do a ssh to different servers and execute a program on each of them, however, I am not able to “automatically” open multiple terminals – one for each server that I’m doing an ssh to.

Advertisement

Answer

You could use this command:

xterm -e /bin/bash -l -c “ssh user@destination”

This opens a new xterm session. There must be similar steps (probably) if you are using another terminal emulator, instead of xterm.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement