https://github.com/tapsboy/bulk-ssh-using-tmux
A brief rundown of how I use tmux to ssh into multiple machines running in AWS ASG
https://github.com/tapsboy/bulk-ssh-using-tmux
aws-ec2 fish-shell jq ssh tmux tmuxinator
Last synced: 3 months ago
JSON representation
A brief rundown of how I use tmux to ssh into multiple machines running in AWS ASG
- Host: GitHub
- URL: https://github.com/tapsboy/bulk-ssh-using-tmux
- Owner: tapsboy
- Created: 2017-03-28T03:05:06.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-29T03:51:04.000Z (over 7 years ago)
- Last Synced: 2025-01-11T05:31:59.243Z (5 months ago)
- Topics: aws-ec2, fish-shell, jq, ssh, tmux, tmuxinator
- Homepage:
- Size: 2.93 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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 Mac1. 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](http://www.teamocil.com/) or [tmuxp](https://tmuxp.git-pull.com). However, the below code is based on tmuxinator yaml)
6. Create the below tmuxinator file```
# ~/.tmuxinator/dynamic-ssh.ymlname: dynamic-ssh
root: ~windows:
- win1:
layout: tiled
panes:
<% @args.each_with_index do |machine, idx| %>
- pane<%= idx + 1 %>:
- ssh @<%= 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](https://unix.stackexchange.com/questions/33271/how-to-avoid-ssh-asking-permission)
7. 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
```