1. 程式人生 > >Authorization Security for Mongodb

Authorization Security for Mongodb

ati god role security mongodb reat log nbsp ase

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"}] } )

Authorization Security for Mongodb