MongoDB 只允许本地访问

不需要用 iptables 帮忙,仅在 mongodb.conf 文件中添加一行配置即可:

bind_ip = 127.0.0.1
然后重新启动服务即可。

如果想要所有 IP 地址都可以访问,可以修改为
bind_ip = 0.0.0.0
然后重新启动服务

猜你喜欢

转载自blog.csdn.net/weixin_41474364/article/details/84549800