Send commands to multiple SSH sessions with Terminator | Opensource.com

Send commands to multiple SSH sessions with Terminator

Streamline management of multiple machines with this handy tool.

4 different color terminal windows with code
Image by : 
Opensource.com
x

Subscribe now

Get the highlights in your inbox every week.

Terminator is a single-window split-screen terminal multiplexer that allows you to send identical keystrokes to all terminals at once. This means you can SSH into any number of machines, run the same commands simultaneously, and see them all at the same time.

Install Terminator with: sudo apt install terminator

Then, when you open the app, it’s just a regular terminal window. You can use it on its own, or right-click somewhere to split the screen, vertically or horizontally. Then you can type into each one individually, or choose the option to broadcast to all windows or a group.

Obviously, great care must be taken when running commands on multiple machines; it’s easy to make a mistake. You must also be aware that running the same command can take varying amounts of time to complete, or can have different outputs. If you type an SSH command to connect to several different servers and hit Enter on them all together, some may require you to type "yes" to continue if you haven’t connected to it before. Typing "yes" and Enter on a machine probably won’t do any harm (actually, try it and see!), but it’s not a habit to get into. If you need to control windows individually, you can turn off "broadcasting" and turn it back on when you’re ready.

I often use Terminator for managing piwheels build servers.

It’s a very handy tool for certain jobs—good to know about!

Data stack in blue

Reduce your secure backup needs to a single key file.
Programming keyboard.

We round up handy SSH commands to help you connect to remote servers.
rainbow colors on pinwheels in the sun

By making pre-compiled Python packages for Raspberry Pi available, the piwheels project saves users significant time and effort.

Topics

About the author

Ben Nuttall - Ben is a software engineer for BBC News Labs, and formerly Raspberry Pi's Community Manager. He's into Linux, Python and all things open source! Follow Ben on Twitter @ben_nuttall.