5

SageMaker Notebooks do not have an "Official" way for ssh connections, although it is possible to find instructions for it using ngrok.

Is it possible to use session manager instead? Although the SageMaker Notebook looks like an ec2 the arn does not starts in the same way, it has arn:aws:sagemaker instead of arn:aws:ec2.

I tried this via aws cli but I get An error occurred (TargetNotConnected) when calling the StartSession operation:

RBA
  • 783
  • 8
  • 20
  • where you able to solve this? Facing exact same issue and navigating through all the web without solution :( – Seymour Dec 21 '22 at 17:22
  • 1
    not in this way, I had to overengineer a solution using a fargate task as bastion. Basically, - I have a fargate task with sshd running and no open ports - from the sagemaker notebook I connect to it using session manager ssh and do a port forwarding, biding the sagemaker 22 to a fix port (5576 for instance) in the task - from my local I do a proxyjump through the task using session manager ssh to the sagemaker notebook. I have automated everything and 6-8 people use this everyday, with a few minor issues but I'd say oeverall it works. I can post a more detailed version if you want. – RBA Dec 23 '22 at 00:07
  • Hi @RBA, thank you for the feedback. This explanation is high level but enough to understand how you solved the problem. So no need to further detail it. Thank you. – Seymour Dec 28 '22 at 09:20
  • Yes it is possible in principle I think - see my comment at https://stackoverflow.com/q/73862464/1021819 – jtlz2 Jan 18 '23 at 10:05

0 Answers0