Skip to content

Instantly share code, notes, and snippets.

@BitBy73Bit
Created September 12, 2018 13:00
Show Gist options
  • Select an option

  • Save BitBy73Bit/c30c7a420b0ac510136e7272b00b8cf7 to your computer and use it in GitHub Desktop.

Select an option

Save BitBy73Bit/c30c7a420b0ac510136e7272b00b8cf7 to your computer and use it in GitHub Desktop.
AWS SSH Bash Helper
#!/bin/sh
USERNAME="ec2-user"
PEMPATH="~/.ssh/ck-production-ec2.pem"
printf "\n*** AWS EC2 SSH ***\n"
if [ "$1" != "" ]; then
printf "Connecting to AWS EC2 Instance with IP: $1\n"
else
printf "Error: Please specifiy an EC2 Instance IP Address\n\n"
exit;
fi
ssh -o StrictHostKeyChecking=no $USERNAME@$1 -i $PEMPATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment