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

I have a problem in connecting a JIRA instance running on a cloud server to an instance of MySQL running on the same box. I have configured it previously using quite a few iptables rules, but it seems overly broad/terribly inprecise. I want access to several of localhosts ports from the local machine, but deny it from all other accounts. Currently, my /etc/iptables.rules file looks like:

:INPUT DROP [223:17779]
:OUTPUT ACCEPT [10161:1120819]

# SSH Access
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -i eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT

# Apache2 Access for connecting to Tomcat on port 8080
-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT 

-I INPUT -i lo -p tcp -m tcp --dport mysql -j ACCEPT

However, this doesn't allow me to log in when I try logging in; it just hangs on:

#> mysql -u root -p -h

The Tomcat servlet container starts throwing all kinds of exceptions, as well.

This is a more general problem, as I need to enable things like accessing the shutdown port for the Tomcat container, but I need to at least get the MySQL part ironed out first, without the ugliness I was originally trying.


share|improve this question

I would suggest adding the following two rules first.

/sbin/iptables -A INPUT -i lo -j ACCEPT
/sbin/iptables -A OUTPUT -o lo -j ACCEPT
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.