Page 1 of 1

Accept remote connection from your website to your MySQL server (safe way)

Posted: Wed Aug 30, 2017 4:52 pm
by regenx
Use this rules:
UFW rule:

Code: Select all

sudo ufw allow from XXX.XXX.XX.XXX to any port 3306
IPTables rule:

Code: Select all

iptables -A INPUT -p tcp --dport 3306 -s XXX.XXX.XX.XXX -j ACCEPT
where XXX.XXX.XX.XXX is your IP from external web server (where your website is hosted).

Re: Accept remote connection from your website to your MySQL server (safe way)

Posted: Sat Sep 02, 2017 9:39 am
by JMD
Thanks. :+1:

Re: Accept remote connection from your website to your MySQL server (safe way)

Posted: Sat Sep 02, 2017 1:15 pm
by Attila
regenx wrote: Wed Aug 30, 2017 4:52 pm Use this rules:
UFW rule:

Code: Select all

sudo ufw allow from XXX.XXX.XX.XXX to any port 3306
IPTables rule:

Code: Select all

iptables -A INPUT -p tcp --dport 3306 -s XXX.XXX.XX.XXX -j ACCEPT
where XXX.XXX.XX.XXX is your IP from external web server (where your website is hosted).
Where should I look to adjust this :eh:

thanks

Re: Accept remote connection from your website to your MySQL server (safe way)

Posted: Sat Sep 02, 2017 6:21 pm
by JMD
Attila wrote: Sat Sep 02, 2017 1:15 pm
regenx wrote: Wed Aug 30, 2017 4:52 pm Use this rules:
UFW rule:

Code: Select all

sudo ufw allow from XXX.XXX.XX.XXX to any port 3306
IPTables rule:

Code: Select all

iptables -A INPUT -p tcp --dport 3306 -s XXX.XXX.XX.XXX -j ACCEPT
where XXX.XXX.XX.XXX is your IP from external web server (where your website is hosted).
Where should I look to adjust this :eh:

thanks
its commands you type on putty or command line prompt on a linux server. Logicaly you can reverse them by typing the opposite. example instead of ACCEPT use DROP.

Re: Accept remote connection from your website to your MySQL server (safe way)

Posted: Sun Sep 03, 2017 7:27 am
by Attila
Oke this is only for linux server

Thanks for the reply

Re: Accept remote connection from your website to your MySQL server (safe way)

Posted: Mon Sep 04, 2017 4:43 am
by regenx
Attila wrote: Sun Sep 03, 2017 7:27 am Oke this is only for linux server

Thanks for the reply
Yes, for Linux Debian based.
Do you know another server OS? :)
Windows Server is NOT a server! Do not use Windows Server, it is Windows OS and that's all.


@JWD
Why reverse with DROP? There is "sudo ufw allow" (for DROP is different). This case is ONLY when you need to allow special IP's but in other case when you don't need .. you better DENY to be sure :)

Re: Accept remote connection from your website to your MySQL server (safe way)

Posted: Mon Sep 04, 2017 9:44 pm
by Sacrifice
regenx wrote: Wed Aug 30, 2017 4:52 pm Use this rules:
UFW rule:

Code: Select all

sudo ufw allow from XXX.XXX.XX.XXX to any port 3306
IPTables rule:

Code: Select all

iptables -A INPUT -p tcp --dport 3306 -s XXX.XXX.XX.XXX -j ACCEPT
where XXX.XXX.XX.XXX is your IP from external web server (where your website is hosted).
As long as the hosting (free in my case), do not have that port closed (which I do not understand since the database server is another server than the hosting) and pretend to charge you for it (like me). Truth hostinger.es ?.

Re: Accept remote connection from your website to your MySQL server (safe way)

Posted: Mon Sep 04, 2017 9:48 pm
by Sacrifice
Or for php fsockopen() command, to check two simple ports, to be locked... Real hostinger.es?

Re: Accept remote connection from your website to your MySQL server (safe way)

Posted: Thu Sep 07, 2017 1:19 pm
by regenx
I do not understand you. What do you need to know?
I don't know hostinger.es and I don't care about hosting companies, this thread is not about hosting companies.

Re: Accept remote connection from your website to your MySQL server (safe way)

Posted: Thu Sep 07, 2017 6:41 pm
by Sacrifice
:think: :wtf: I'm not need to know nothing... for now at least... :lolno: