Skip to content

A brief rundown of how I use tmux to ssh into multiple machines running in AWS ASG

Notifications You must be signed in to change notification settings

tapsboy/bulk-ssh-using-tmux

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 

Repository files navigation

bulk-ssh-using-tmux

Just a brief description of how I use tmux to ssh into multiple ec2 instances running on AWS ASG from my Mac

  1. Install homebrew from https://brew.sh/
  2. brew install fish
  3. brew install jq
  4. brew install tmux
  5. gem install tmuxinator. (If you don't like tmuxinator, you may try out Teamocil or tmuxp. However, the below code is based on tmuxinator yaml)
  6. Create the below tmuxinator file
# ~/.tmuxinator/dynamic-ssh.yml

name: dynamic-ssh
root: ~

windows:
  - win1:
      layout: tiled
      panes:
        <% @args.each_with_index do |machine, idx|  %>
        - pane<%= idx + 1 %>:
          - ssh <your-ssh-user>@<%= machine %>
        <% end %>

If you frequently connect to new hosts and want to avoid specifying yes everytime, you can add -o StrictHostKeyChecking=no to your ssh command. More info here

  1. Create the below fish function
# ~/.config/fish/functions/launch.fish
function launch
  tmuxinator start dynamic-ssh ( curl "{API-URL-to-get-JSON-array-of-ec2-instance-name}" | jq -r 'join("\n" )' )
end

About

A brief rundown of how I use tmux to ssh into multiple machines running in AWS ASG

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published