Skip to content

Instantly share code, notes, and snippets.

@nsa-yoda
Last active April 10, 2018 06:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nsa-yoda/5504879 to your computer and use it in GitHub Desktop.
Save nsa-yoda/5504879 to your computer and use it in GitHub Desktop.
Small bash script to open multiple terminal windows and auto SSH to several servers
#!/bin/bash
# Dependencies: gnome, sshpass, ssh, gui
gnome-terminal --maximize --tab --title='Hades' --command 'sshpass -p "afsd@#$5u89f" ssh root@192.168.0.125' \
--tab --title='Kronos' --command 'sshpass -p "sad;fi@#$0al" ssh root@192.168.0.126' \
--tab --title='Zeus' --command 'sshpass -p "afsd@#$5u89f" ssh root@192.168.0.127' \
--tab --title='Midas' --command 'sshpass -p "sad;fi@#$0al" ssh root@192.168.0.128' \
--tab --title='Thor' --command 'sshpass -p "afsd@#$5u89f" ssh root@192.168.0.129' \
--tab --title='Herc' --command 'sshpass -p "sad;fi@#$0al" ssh root@192.168.0.130'
@8826101999
Copy link

8826101999 commented Apr 10, 2018

Hi, I'm new to shell scripting, but I was wondering is there any way that we can run these processes synchronously?
(I mean, Kronos terminal gets executed after completion of Hades and so on)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment