I am trying to set up port forwarding between my local PC and an AWS EC2 based on the AWS SSM port forwarding article instance like this:
aws ssm start-session --target i-0822c9a6c52ca7394 \
--document-name AWS-StartPortForwardingSession --parameters \
'{"portNumber":["55555"],"localPortNumber":["6666"]}'
I already use SSM to access the instance (using ssm-session) and have used it to start python -m SimpleHTTPServer 55555
listening on the port.
The output I get from SSM is just this:
Starting session with SessionId: jakub.holy@481473109573-0dd8f51cc06ef4469
(And, eventually, after a long while: SessionId: jakub.holy@481473109573-0dd8f51cc06ef4469 : Your session timed out due to inactivity and has been terminated. - and I still need to
kill
it.)
at which point it hangs. I have expected, but do not see, the following, right after "Startin session...":
Port 6666 opened for sessionId ....
Connection accepted for session .....
Any idea why is it hanging and not establishing the port forwarding?