How to use privileges port less than 1024 with non-root user

original url: https://blogs.oracle.com/sduloutr/binding-a-server-to-privileged-port-on-linux-wo-running-as-root

Using setcap command, for example, if you tomcat run with 80 with user tomcat

# setup the net bind program
setcap 'cap_net_bind_service=+epi' $JAVA_HOME/bin/java
# start tomcat
systemctl start tomcat
# check port
netstat -ant |grep 444
tcp        0      0 0.0.0.0:444             0.0.0.0:*               LISTEN

All done!

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay

Leave a Reply

Your email address will not be published. Required fields are marked *