I wanted to use port 80 for a node.js server. I was unable to do it since Node.js was installed for a non-sudo user. I tried to use symlinks, but it didn't work for me. Then I got to know that I can forward connections from one port to another port. So I started the server on port 3000 and set up a port forward from port 80 to port 3000.
I have read VirtualBox port forwarding guide, similar questions in this site and other sites but couldn't find a solution. UFW is enabled on Guest OS (Ubuntu), port 80 and 22 are open. I can ssh from host to ubuntu and can access ubuntu site from host browser. On Guest, I setup Nat and hostonly (vboxnet3) adapters. How To Forward Ports To Your Ubuntu 12.04 LTS LAMP Server How To Forward Ports To Your Ubuntu 12.04 LTS LAMP Server. This how-to is a wrapper for the fantastic portforwarding help site www.portforward.com To support, and make it very easy for, those who want to set up a home server on an ubuntu 12.04 LTS server running LAMP How to Forward Ports on Your Router Dec 09, 2019 How to Enable IP Forwarding Under Ubuntu/Linux Mint net.ipv4.ip_forward = 1 However, IP Forwarding will be disabled once you reboot your system. For a permanent configuration, see below. Enabling IP Forwarding Permanently Open the terminal and edit the /etc/sysctl.conf file with this command: sudo gedit /etc/sysctl.conf Search and uncomment this line: net.ipv4.ip_forward = 1
Docker: Port Forwarding for Docker Container through
linux - Allow non-root process to bind to port 80 and 443 I wanted to use port 80 for a node.js server. I was unable to do it since Node.js was installed for a non-sudo user. I tried to use symlinks, but it didn't work for me. Then I got to know that I can forward connections from one port to another port. So I started the server on port 3000 and set up a port forward from port 80 to port 3000. VNC - Community Help Wiki Oct 10, 2012
With UFW, you can allow or block ports using App profiles. For example, let’s say you want to allow or block the port 80, which is the default port for Apache web server. Instead of telling UFW to allow or block port 80, you can just tell it to block the Apache app profile. That’s a really nice feature of UFW firewall.
In addition to @Will's answer, its possible that whichever Ubuntu AMI you're using came with restrictive iptables rules by default. Use: sudo iptables -L to list any current rules that exist. Use: sudo iptables -A INPUT -p tcp --dport 5000 -j ACCEPT to open the port if necessary. A Guide to SSH Port Forwarding/Tunnelling - Boolean World