0
I'm able to connect to my EC2 instance from my local computer, but would like to access files on my computer from EC2. I have already generated a key pair on EC2 and added the public key to my authorized_keys
file on my local computer. However, the following command fails:
ssh ec2-user@172.XX.X.XX
With the error:
ssh: connect to host 172.XX.X.XX port 22: Connection timed out
where the IP address is my computer's IP address. What am I missing?
I have been told about port forwarding my router, but I am not sure how to go about that.
Is
ssh ec2-user@172.XX.X.XX
your connection to your local computer? Are you sure that172.XX.X.XX
is your public address? – JakeGould – 2018-04-02T00:55:16.103The 172.XX.X.XX IP is what is shown when I go to System Preferences > Network on my Mac. In addition, when I go to System Preferences > Sharing, I have Remote Login set to On, and am told that I can access my computer remotely with
ssh nole@172.XX.X.XX
– Nole – 2018-04-02T01:10:13.653“The 172.XX.X.XX IP is what is shown when I go to System Preferences > Network on my Mac” That is most likely your internal routed address since this typically start with 192, 172 and 10. To find your external addresses you need to go to to an external website like this one. You can try and see if that would work, but to be able to access your home system remotely some remote login capability would need to be active on your system (which you do) but also make sure your external IP address can route to your internal one.
– JakeGould – 2018-04-02T01:25:25.410Also asked and answered but closed at https://stackoverflow.com/questions/49595737/unable-to-ssh-to-my-local-computer-from-ec2-instance
– dave_thompson_085 – 2018-04-02T07:42:41.090