Secure your access to bastion host using SSM, Windows CLI access, RDP, port forwarding and lots more....
Dinesh Sharma
Mentor | AWS Ambassador | Puluminary | AWS Community Builder | AWS Regional Practice Lead | IaC Ninja | Desi | PB13 | RJ19
Amazon Elastic Compute Cloud (EC2) instances are widely used for hosting web servers, application servers, and other workloads in the cloud. To manage these instances, Amazon offers several options, including Secure Shell (SSH), Remote Desktop Protocol (RDP), and other remote access tools. However, these methods require open inbound ports and public IP addresses, which can pose security risks. AWS Systems Manager Session Manager offers a secure and convenient alternative to these traditional methods for accessing EC2 instances.
In this blog post, we will discuss how to connect to EC2 instances via Session Manager, the benefits of Session Manager, why it is secure, and other features.
Benefits of Session Manager
AWS Systems Manager Session Manager offers several benefits over traditional remote access methods:
Why is Session Manager secure?
AWS Systems Manager Session Manager is a secure alternative to traditional remote access methods, such as SSH or RDP, for several reasons:
Other features of Session Manager
AWS Systems Manager Session Manager offers several additional features to simplify the management of your EC2 instances:
Connecting to EC2 instances via Session Manager
In this blog, we are going to focus on:
The best part about this solution is, you do not need to have any SG inbound rules, yes you heard it right :), which makes it more secure.
CLI access to Linux EC2 instance from Windows PowerShell
session-manager-plugin
aws ssm start-session --target <instance_id> --region <region>
As, you can see I can login to a Linux based instance, from my windows workstation.
RDP access to Windows based EC2 instance using port forwarding
aws ssm start-session --target <instance-id> --document-name AWS-StartPortForwardingSession --parameters "portNumber=3389","localPortNumber=<local_port_number>" --region ap-southeast-2
AWS Systems Manager Session Manager provides a secure and convenient way to manage your EC2 instances. With its browser-based and CLI interface, SSL encryption, and integration with IAM, you can control who has access to your instances and reduce any potential threats.