Open several ssh terminals at once

From Sea of Fate
Revision as of 18:42, 28 February 2025 by Nigel (talk | contribs)
Jump to navigationJump to search

Introduction

Continuing the theme of Random stuff and more particularly of Code Snippets and Linux Bash & Shell. This is how to open several terminals at once.

The First version

Open a text file with the ext of .sh

nano ./open_prod_terminals.sh

Copy the following into the file.

#!/bin/bash
# Open SSH sessions in separate terminal windows
gnome-terminal --tab --title="logan" -- bash -c "ssh logan; exec bash"
gnome-terminal --tab --title="fig" -- bash -c "ssh fig; exec bash"
gnome-terminal --tab --title="mandarin" -- bash -c "ssh mandarin; exec bash"
exit 0