1

I'm a newbie and needing help. Currently playing with the following setup: remote machine an AWS EC2 instance with Ubuntu 18.

I am trying to access Jupyter notebook running in Docker container in AWS EC2 machine but not able to access it. Time out Error

i tried the following command for port tunnelling i read somewhere

ssh -L 8080:localhost:8080 -i /home/user/admin_keypair.pem ec2user@ec2-xx-xxx-xx-xxx.us-east-2.compute.amazonaws.com

but getting this error

Warning: Identity file /home/user/admin_keypair.pem not accessible: No such file or directory. Permission denied (publickey,gssapi-keyex,gssapi-with-mic)

2
  • How do you usually connect to instance via SSH? (just to access terminal)
    – Pavlus
    Oct 18, 2019 at 12:16
  • ssh -i /path/my-key-pair.pem ec2-user@ec2-198-51-100-1.compute-1.amazonaws.com using this command Oct 19, 2019 at 4:56

1 Answer 1

0

Maybe adding the path to your .pem file within double quotes, see below.

I had something similar, adding the -4 flag worked for me, by default it was using ipv6 and I did not have it enabled.

ssh -4 -L 8080:localhost:8080 -i "/home/user/admin_keypair.pem" ec2user@ec2-xx-xxx-xx-xxx.us-east-2.compute.amazonaws.com

And anyone else who may have an issue, adding the flag -v will output debugging info that might help you figure out why it was not working.

ssh -4 -v -L 8080:localhost:8080 -i "/home/user/admin_keypair.pem" ec2user@ec2-xx-xxx-xx-xxx.us-east-2.compute.amazonaws.com

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.