Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Currently my tomcat is running as root because it does bind to port 80.

I do want to run hudson as a non-root user inside tomcat. How do I do this?

I'm looking for a solution that would not require me to add an apache proxy over tomcat.

share|improve this question
up vote 4 down vote accepted

well, only root can bind to ports le 1024. probably there's no mechanism of dropping privs in java/jvm after binding to superuser ports otherwise this would be done by now in tomcat. what i and others did was to keep tomcat listening on a non-privileged port and forward port 80 traffic to that port with a firewall rule.

share|improve this answer
i wasn't exactly right. you may use jsvc to run the workers as a non privileged user. check – sysfault Oct 13 '10 at 15:42

You can forward port 80 to 8080 or any other using iptables, like this:

iptables -t nat -A PREROUTING -p tcp -d second_ip --dport 80 -j REDIRECT --to-port 8080

This is a more generic one, but if you have only one IP remove the destination IP (-d second_ip).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.