How to run node.js as non-root user?

后端 未结 3 1438
天命终不由人
天命终不由人 2021-02-02 14:15

I\'m running a node.js server, that will serve requests on port 80 amongst others. Clearly this requires the application running as root (on Linux).

Looking at this post

3条回答
  •  忘了有多久
    2021-02-02 14:47

    (I haven't got enough reputation to add a comment the the one of Matt Browne, so I write this as an answer. Feel free to edit.)

    There is a simpler method to load iptables rules automatically after a reboot than the one described in the link of Matt Browne: One can install iptables-persistent from the repositories using apt-get:

    apt-get install iptables-persistent
    

    Rules still need to be saved manually like this:

    IPv4:

    iptables-save > /etc/iptables/rules.v4
    

    IPv6:

    iptables-save > /etc/iptables/rules.v6
    

    (Source: http://www.thomas-krenn.com/de/wiki/Iptables_Firewall_Regeln_dauerhaft_speichern (german))

提交回复
热议问题