MongoDB "루트"사용자
MongoDB에 대한 "루트"사용자와 같은 슈퍼 UNIX가 있습니까? 나는 http://docs.mongodb.org/manual/reference/user-privileges/를 살펴보고 많은 조합을 시도했지만 모두 한 영역 또는 다른 영역에서 부족한 것 같습니다. 분명히 거기에 나열된 모든 역할 위에있는 역할이 있습니다.
기본적으로 MongoDb에는 인증이 없지만 admin데이터베이스에 대한 특정 사용자에 대한 "임의의"역할을 사용하여 루트 / 슈퍼 유저에 해당하는 것을 만들 수 있습니다 .
이 같은:
use admin
db.addUser( { user: "<username>",
pwd: "<password>",
roles: [ "userAdminAnyDatabase",
"dbAdminAnyDatabase",
"readWriteAnyDatabase"
] } )
2.6 이상 업데이트
2.6에 새로운 루트 사용자 가 있지만 여전히 몇 가지 제한 사항이 있으므로 요구 사항을 충족하지 못할 수 있습니다.
readWriteAnyDatabase, dbAdminAnyDatabase, userAdminAnyDatabase 및 clusterAdmin 역할이 결합 된 작업 및 모든 리소스에 대한 액세스를 제공합니다.
root는 시스템으로 시작하는 컬렉션에 대한 액세스를 포함하지 않습니다. 접두사.
3.0 이상 업데이트
제거 된 db.createUser대로 사용합니다 db.addUser.
3.0.7 이상 업데이트
root 에는 더 이상 위에 언급 된 제한이 없습니다.
루트에는 시스템에 대한 권한 유효성 검사 작업이 있습니다. 컬렉션. 이전에는 루트가 시스템으로 시작하는 컬렉션에 대한 액세스를 포함하지 않았습니다. system.indexes 및 system.namespaces 이외의 접두사.
최고의 수퍼 유저 역할은 root 입니다. 구문은 다음과 같습니다.
use admin
db.createUser(
{
user: "root",
pwd: "password",
roles: [ "root" ]
})
자세한 내용은 기본 제공 역할을 참조하십시오.
도움이 되었기를 바랍니다 !!!
Mongodb 사용자 관리 :
역할 목록 :
read
readWrite
dbAdmin
userAdmin
clusterAdmin
readAnyDatabase
readWriteAnyDatabase
userAdminAnyDatabase
dbAdminAnyDatabase
사용자 생성 :
db.createUser(user, writeConcern)
db.createUser({ user: "user",
pwd: "pass",
roles: [
{ role: "read", db: "database" }
]
})
사용자 업데이트 :
db.updateUser("user",{
roles: [
{ role: "readWrite", db: "database" }
]
})
드롭 사용자 :
db.removeUser("user")
또는
db.dropUser("user")
사용자보기 :
db.getUsers();
more information: https://docs.mongodb.com/manual/reference/security/#read
There is a Superuser Roles: root, which is a Built-In Roles, may meet your need.
"userAdmin is effectively the superuser role for a specific database. Users with userAdmin can grant themselves all privileges. However, userAdmin does not explicitly authorize a user for any privileges beyond user administration." from the link you posted
참고URL : https://stackoverflow.com/questions/20117104/mongodb-root-user
'IT TIP' 카테고리의 다른 글
| 리소스가 글꼴로 해석되지만 MIME 유형 application / x-font-woff로 전송 됨 (0) | 2020.12.09 |
|---|---|
| Apache http 서버에 mod_proxy 설정 (0) | 2020.12.09 |
| typeof는 연산자이자 함수입니다. (0) | 2020.12.09 |
| 오류 3002 : 조각 매핑 문제 | (0) | 2020.12.09 |
| Underscore.js : 객체에있는 키를 사용하여 객체 목록에서 맵을 만듭니다. (0) | 2020.12.09 |