0

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:

*filter
:INPUT DROP [223:17779]
:FORWARD ACCEPT [0:0]
: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 

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

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

#> mysql -u root -p -h 127.0.0.1

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.

Thanks.

Gabe Mc
  • 101
  • 1

1 Answers1

1

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
Zoredache
  • 128,755
  • 40
  • 271
  • 413