Find the answer to your Linux question:
Results 1 to 3 of 3
i'm using amazon ec2 server, i've installed mysql on it and i'm trying to access it remotely. you can see all what i've tried here: hxxps://forums.aws.amazon.com/thread.jspa?messageID=472234 (change hxxps to https). ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2013
    Posts
    2

    unable to access server, problem in iptables


    i'm using amazon ec2 server, i've installed mysql on it and i'm trying to access it remotely. you can see all what i've tried here: hxxps://forums.aws.amazon.com/thread.jspa?messageID=472234 (change hxxps to https).

    in shortcut if i stop the iptables (`service iptables stop`) i can access the mysql remotely, but if i start it i can not.

    here are the rules regards the iptable i've tried:

    Code:
    sudo /sbin/iptables -A INPUT -i eth0 -p tcp --destination-port 3306 -j ACCEPT
    sudo iptables -A INPUT -i eth0 -s [my-ip] -p tcp --destination-port 3306 -j ACCEPT
    sudo iptables -A INPUT -i eth0 -p tcp -m tcp --dport 3306 -j ACCEPT

  2. #2
    Linux Engineer
    Join Date
    Apr 2012
    Location
    Virginia, USA
    Posts
    881
    You may have a rule higher in the INPUT chain that specifies all other packets must be dropped. When using iptables, the -A switch = APPEND. if you run iptables -L you might see a line such as
    REJECT all -- anywhere anywhere reject-with icmp-host-prohibited
    In your case, you can change the -A to -I for INSERT, which will put your rules at the top of the INPUT chain.

  3. #3
    Just Joined!
    Join Date
    Jul 2013
    Posts
    2
    Thanks a lot, it works!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •