庄泽波の博客

好记性不如烂笔头

Authorization Security for Mongodb

To keep security for the mongodb server, we can create an authorized machanism.

 

db.createUser(
    {
        user: "user1",
        pwd: "passwd",
        roles:[{"role": "userAdminAnyDatabase", "db": "admin"}]

    }
)

db.createUser(
    {
        user: "user2",
        pwd: "passwd",
        roles:[{"role": "readWrite", "db": "database"}]

    }
)

 

posted on 2017-06-01 13:44  庄泽波  阅读(152)  评论(0编辑  收藏  举报

导航