I have software which needs to run as a non-root user, but needs to listen on port 80 and 443.
With iptables, this isn't all that difficult:
sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080 sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 8080
Though this is simple, how should I persist it to take effect on boot? I tried
iptables-save, but this didn't seem to work.