Lightsail Instance SSH Connection not build into Mac terminal : Error ssh: connect to host 172.26.13.112 port 22: Operation timed out

1

Hi šŸ‘‹ Folks,

I am using Macbook M2 Pro Terminal to get connect with my light sail instance, unfortunately, it gives an error on terminal which is underfollowing

ssh: connect to host (Lightsail instance Ip port 22): Operation timed out

However, I have provided all details including proper parameters as defined by Amazon Articles with absolute path like
ssh -i /Users/amirali/Desktop/SecurityKeysFile/xyz.pem root@IPaddress

that's how I give path as per file is save in above location. On other hand, I have follow the this Amazon article https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-ssh-using-terminal#terminal-ssh-change-key-file-permissions

Unfortunately, it's been more than 2 days unable to resolve, get stuck therefore, my all work is In complete

However, I am familiar with Linux therefore, I just need small assistance to get this work done.

What I have found through systemctl status sshd

https://paste.pics/f22db5717fb96c4d60b59d57a1efe8ec

looking forward to hearing from seniors

Thanks Amir Ali

asked 10 months ago328 views
5 Answers
0
Accepted Answer

From timeout error it look like there is some issue with network config or firewall.

Can you check the 22 port is filtered?

$ nmap <SERVER IP> -Pn -p 80

If it is filtered check the firewall settings https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-editing-firewall-rules

answered 10 months ago
profile picture
EXPERT
reviewed 3 hours ago
  • Hi there,

    Thanks for you're response , I have checked with your above given method screenshot is attached, yes the port is filtered

    still I'm unable to get connect with Lightsail instance

    kindly provide complete solutions

    thnaks Amir Ali

0

Hi Folks

Where is the Amazon official Support, its been 2 days my website down.

Should I left this platform

Thanks

answered 10 months ago
  • Hi there,

    Thanks for you're response , I have checked with your above given method screenshot is attached, yes the port is filtered

    still I'm unable to get connect with Lightsail instance

    kindly provide complete solutions

    thnaks Amir Ali

0

Enter image description here Hi there,

Thanks for you're response , I have checked with your above given method screenshot is attached, yes the port is filtered

still I'm unable to get connect with Lightsail instance

kindly provide complete solutions

thnaks Amir Ali

answered 10 months ago
0

I am facing the same issue, after creating multiple instances in lightsails, after using it for 30min to 2hrs, my ssh automatically gets shutdown & if I again try to connect, it always says "Opertaion timeout"

Looks like there is some issue in Lightsail Ubuntu instances.

Even if I try clicking on "connect using SSH" button on instance, a popup opens, but we cannot do anything, as nothing shows up or even cannot type anything.

Enter image description here

parth
answered 7 months ago
0

Finally Figured out the issue, by creating another instance & was trying to replicate my issue that is: "ssh: connect to host x.x.x.x port 22: Operation timed out". on my lightsail instance.

Why I am unable to connect to the instance via SSH is that I did turn on the UFW in my ubuntu instance by typing sudo ufw enable, that is the main mistake I made, after doing this when I tried to connect my instance again via same steps, I was unable to connect.

The solution is, whenever we turn on the ufw, we must allow ufw with port 22, by running the command sudo ufw allow 22

parth
answered 7 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions