2
I am using MongoDB database, which is installed with the IP address 126.22.252.25. The Ubuntu version info is 12.04.3 LTS.
My MongoDB uses the default 27017
port. On this local machine I can use command mongo --host 126.22.252.25
on the local machine to access, but I cannot use this command on any other Linux machine to access MongoDB, nor can I use telnet 126.22.252.25 27017
on my Windows machine.
I am sure 126.22.252.25
machine is accessible from Internet because I can use winSCP
and secureCRT
to login to it. If I run command netstat -tnlp
, it shows:
tcp 0 0 0.0.0.0:27017 0.0.0.0:* LISTEN
I have already changed the /ect/mongodb.conf
file, modifying bind_ip
parameter from 0.0.0.0
to 126.22.252.25
.
What else can I do?
Late to comment on this question, but is that
126.22.252.25
address—or should I say, “was” that address—really the IP address of the MongoDB server? Because you generally never want a database server open to the world even if the credentials limit access. There should always be firewall rules in place that would limit access to the machine to a specific IP address. Opening up a MongoDB or MySQL instance to the world is asking for trouble. Either the server might be hacked or at least slowed down by DDoS attempts connected to hacking. – JakeGould – 2015-10-27T05:31:31.547