Redirecting to another port using iptables

One of the things that I hate about nodejs is that I will have to run it as root if I want to use the port 80, but yesterday while I was reviewing a book called Mastering Web Application Development with Express and one of the solutions which he talked about so that you dont need to use the root user is to redirect the ports using iptable , so this is what you have to do :

remember to change eth0 to the one you are connecting to, in my vagrant it was eth1

And since iptable does not save anything as permanent, you have to do small work (read more about it here)

And we are done, no need to use the root account any more šŸ˜‰


PS: This article will work with ubuntu < 16.04 , because serviceĀ does not work with ubuntu 16.04 as I know, but not 100% sure.

1 Trackback

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.