Score:0

Ec2 instance SSH access:not able to connect after the nginx installation

br flag

I am getting a weird issue in my EC2 instance.

After the successfull creation i am able to login to server via ssh commad, but onece afte i installed the nginx , i m not able to access the server via ssh.

I am getting connection timeout error, not sure why thats happening.

ssh: connect to host ****.amazonaws.com port 22: Connection timed out

Nginx installation stpes

sudo apt install nginx

sudo ufw allow 'Nginx HTTP'

However i can able to see the webpage via browser but not able to access the server via ssh

Appleoddity avatar
ng flag
I don’t think AWS provided AMIs come with a firewall enabled because that’s what security groups are for. You’re probably enabling UFW and locking yourself out of the instance. If you insist on using UFW and managing two sets of firewall rules, you’ll need to open the SSH port too.
Score:0
tk flag

You just need to allow 'OpenSSH'

  • List the application configurations that ufw knows how to work with by typing

sudo ufw app list

  • You can enable this by typing

sudo ufw allow 'Nginx HTTP

  • You can verify the change by typing

sudo ufw status

this is from: https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-22-04#step-2-adjusting-the-firewall

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.