dictcp / jump.sh

a simple script for ssh to AWS EC2 nodes based on Name Tag and Instance ID, with tab auto-completion

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jump.sh

a simple script for ssh to AWS EC2 nodes based on Name Tag and Instance ID, with tab auto-completion

$ jump.sh stg-limestone- # pressing TAB
stg-limestone-api-0ce455a75    stg-limestone-api-060162c  stg-limestone-worker-0791deb1d  

Setup

# please make sure you have awscli and jq installed
# macOS user can install them via brew install awscli jq

# clone it
git clone https://github.com/dictcp/jump.sh ~/.jumphost
echo '. ~/.jumphost/auto-completion.sh' >> ~/.bashrc # or .zshrc, depending which shell you use

# and please modify dev.apse1.sh to fit your environment
cd ~/.jumphost/generator.d
cp dev.apse1.example dev.apse1.sh

# please also add ssh username as EC2 Tag `SshUser` to your EC2 Instances
# and then the proper user will be used when jump.sh is executed

# you may also consider to modify jump.sh to leverage jumphost via option `ProxyJump`
# ref: https://en.wikibooks.org/wiki/OpenSSH/Cookbook/Proxies_and_Jump_Hosts

Access instances with SSH key

There is no explicit way to config ssh key on specific connection. We can use ssh-add to set up connection with SSH automatically.

Other similar projects

About

a simple script for ssh to AWS EC2 nodes based on Name Tag and Instance ID, with tab auto-completion


Languages

Language:Shell 100.0%