DEV Community

Hassan Murtaza
Hassan Murtaza

Posted on • Updated on

Wrapper over AWS Session Manager to SSH using Public/Private IP

Previously on AWS, we had two problems with establishing SSH sessions to EC2 instances.

  1. It's hard to manage SSH keys, especially if when we have a lot of servers.
  2. It was hard to open sessions to private instances as you need the bastion host to do so.

AWS Session Manager solved both of these issues for us. Moreover, it is an AWS-centric solution so we preferred it.

Moreover, we needed a way to establish an SSH connection to instances using public IP or private IP as we were doing ssh using IPs before. AWS CLI doesn't support it out of the box (it supports only instance-id). I wrote this wrapper script over AWS CLI to achieve the same.

Repository link: https://github.com/MrHassanMurtaza/ec2-ssh/

Top comments (0)