首页/网络/常用端口速查/27017 MongoDB 数据库端口
本包目录(1171 条)

27017 MongoDB 数据库端口

MongoDB 默认端口:mongod 与 mongos 都监听 27017,也是数据库安全的"重灾区"——历史上一度数十万实例公网裸奔,成为批量勒索事件的主角。

常用端口速查网络更新于 2026-10-12
服务MongoDB mongod/mongos(默认 27017)
协议TCP(MongoDB Wire Protocol)
用途NoSQL 数据库接入与查询
安全等级严禁公网,必须认证 + 限网段 + 备份

自 3.6 起默认只监听 127.0.0.1;一旦为远程访问把 bindIp 改成 0.0.0.0 又没开认证(或沿用无密码老库),等于把全量读写权开放给全网,2020 年前后的大规模 MongoDB 勒索就是这套组合造成的。

监听与认证核对

监听与认证核对
ss -lntp | grep 27017
mongosh --host 127.0.0.1 --port 27017 -u admin -p --authenticationDatabase admin --eval 'db.runCommand({ping:1}')

易错点

  • bindIp 0.0.0.0 + 无认证:扫描器几分钟就能定位并清空数据;公网库必须认证、防火墙、定期备份三件套齐备

数据来源与参考

  • MongoDB 官方文档(默认端口 27017 与 bindIp 安全建议)

相关工具

​‌‌​​‌​​​‌‌​‌‌‌‌​‌‌​​​‌‌​‌‌‌​​‌‌​​‌​‌‌‌​​‌‌‌​​​‌​‌‌​‌​​‌​‌‌‌​​​‌​‌‌​‌​​‌​‌‌​​​‌‌​‌‌‌​‌​​​‌‌​‌‌‌‌​​‌​‌‌‌​​‌‌​​​‌‌​‌‌​‌‌‌‌​‌‌​‌‌​‌