MongoDB数据库数据突然消失 数据丢失

浅岚 -
MongoDB数据库数据突然消失 数据丢失
查找原因

感觉是被黑了
看了一眼数据库给我整笑了
截屏2022-07-29 10.18.42.png
内容是

All your data is a backed up. You must pay 0.05 BTC to 1Kz6v4B5CawcnL8jrUvHsvzQv5Yq4fbsSv 48 hours for recover it. After 48 hours expiration we will leaked and exposed all your data. In case of refusal to pay, we will contact the General Data Protection Regulation, GDPR and notify them that you store user data in an open form and is not safe. Under the rules of the law, you face a heavy fine or arrest and your base dump will be dropped from our server! You can buy bitcoin here, does not take much time to buy https://localbitcoins.com or https://buy.moonpay.io/ After paying write to me in the mail with your DB IP: [email protected] and/or [email protected] and you will receive a link to download your database dump.

翻译成人话就是转我0.05BTC(约16103人民币)就给你恢复,48小时不给我转,我就黑你服务器

我肯定是不能转的,里面都是测试数据,没有密码

解决方法

要设置个密码,然后端口号不能用27017,太容易被扫到了
设置密码

use admin

db.createUser({user:"yonghuming",pwd:"mima",roles:["root"]})

密码尽量复杂一点,然后查看密码

show users

找到 MongoDB 安装目录,打开 mongod.cfg文件,找到以下这句:

#security:

修改为:

security:
  authorization: enabled

增加权限验证就好了

特别申明:本文内容来源网络,版权归原作者所有,如有侵权请立即与我们联系(cy198701067573@163.com),我们将及时处理。

Tags 标签

node.jsmongodbmongodmongodb-express

扩展阅读

加个好友,技术交流

1628738909466805.jpg