Skip to content

Can not connect to lightsail server even on web ssh, port is open

0

Enter image description here Can not connect to Lightsail server even on web ssh, the port 22 is open, the instance is running, restart not work. my web host on it, the web still can access.

3 Answers
0

Hello.

It may be blocked by a firewall on the Lightsail OS side.
Try running the command in your startup script when restoring from a snapshot as described in "An OS-level firewall is blocking SSH port access" in the following document:
https://repost.aws/knowledge-center/lightsail-resolve-ssh-console-errors

sudo ufw disable
sudo iptables -F
sudo mv /etc/hosts.deny /etc/hosts.deny_backup
sudo touch /etc/hosts.deny
sudo systemctl enable sshd
sudo systemctl restart sshd
EXPERT
answered a year ago
EXPERT
reviewed a year ago
  • I tried this, but I still can't connect. It appears the same error.

0

Hi,

I would try creating a new instance from a snapshot with a larger bundle and seeing if that resolves the issue. If that resolves the issue, you likely need a larger plan for your application. If you are still seeing issues, you could try creating a snapshot of the instance root volume and attaching it to a new instance to copy the data over. https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-create-an-instance-root-volume-snapshot.html

You can also try connecting to your instance via a local SSH client to rule out firewall configuration issues.

You can follow this doc if your local machine uses MacOS or Linux: https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-ssh-using-terminal.html

You can follow this doc if your local machine uses windows: https://docs.aws.amazon.com/lightsail/latest/userguide/lightsail-how-to-ssh-connect-to-instance-virtual-private-server-using-putty.html

AWS
answered a year ago
0

Hello,

Were you able to connect to your instance? if you are still running into issues, please cut us a customer ticket.

AWS
answered 9 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.