User Tools

Site Tools


cloud:aws:system_manager

System Manager

Use for port forwarding

https://aws.amazon.com/blogs/aws/new-port-forwarding-using-aws-system-manager-sessions-manager/

  1. Set the region: eu-west-1
  2. add the ProxyCommand to the ssh configuration

https://www.nclouds.com/blog/ssh-session-manager/

# SSH over Session Manager

host i-* mi-*

ProxyCommand sh -c "aws ssm start-session --target %h --document-name AWS-StartSSHSession --parameters 'portNumber=%p'"

As an alternative run the command manually

# creates the port forwarding tunnel
aws ssm start-session --target $INSTANCE_ID \
                       --document-name AWS-StartPortForwardingSession \
                       --parameters '{"portNumber":["80"],"localPortNumber":["9999"]}'
  1. connect to localhost:9999 to reach “INSTANCE_ID:80”
Starting session with SessionId: sst-00xxx63
Port 9999 opened for sessionId sst-00xxx63
Connection accepted for session sst-00xxx63.
cloud/aws/system_manager.txt · Last modified: 2023/11/01 07:13 by skipidar