Home > Software design >  is it possible to access a ec2 instance where inbound rule is only allowed for ssh with the help of
is it possible to access a ec2 instance where inbound rule is only allowed for ssh with the help of

Time:01-12

I need to access an ec2 instance using http but inbound rule is only allowed for ssh.So is it possible to access the ec2 through http if i connected the ec2 using ssh and installed apache http.

It can be resolved using changing the inbound rule but is it possible by apache http without changing the inbound rule

CodePudding user response:

Yes. You can activate Port Forwarding across your SSH connection, which will allow traffic to go across the SSH connection to the web server on the destination EC2 instance, and it will all happen via port 22 (SSH).

For example, this command will forward local port 8000 to the remote port 80:

ssh -i key.pem ec2-user@IP-ADDRESS -L 8000:localhost:80

You can then access the remote web server from your own computer by pointing your web browser to http://localhost:8000. The traffic will be sent across the SSH connection to the EC2 instance, where it will be sent to localhost:80 (which is the web server on the EC2 instance).

For details, see: How to Use SSH Port Forwarding {Ultimate Guide}

  •  Tags:  
  • Related