- Mastering MongoDB 3.x
- Alex Giamas
- 176字
- 2021-08-20 10:10:59
Kerberos authentication
MongoDB Enterprise Edition also offers Kerberos authentication. Kerberos, named after the character Kerberos (or Cerberus) from Greek mythology, the ferocious three-headed guard dog of the underworld, Hades, focuses on mutual authentication between client-server protecting against eavesdropping and replay attacks.
Kerberos is widely used in Windows systems, through integration with Microsoft's Active Directory. To install Kerberos, we need to start mongod without Kerberos set up and then connect to the $external database (not the admin that we normally use for admin authorization) and create a user with a Kerberos role and permissions:
use $external
db.createUser(
{
user: "mongo_book_user@packt.net",
roles: [ { role: "read", db: "mongo_book" } ]
}
)
In the preceding example, we are authorizing the mongo_book_user@packt.net user to read our mongo_book database, just like we would do with a user using our admin system.
After that, we need to start our server with Kerberos support by passing in the authenticationMechanisms parameter:
--setParameter authenticationMechanisms=GSSAPI
And now we can connect from our server or command line:
$ mongo.exe --host <mongoserver> --authenticationMechanism=GSSAPI --authenticationDatabase='$external' --username mongo_book_user@packt.net
- 大數(shù)據(jù)導(dǎo)論:思維、技術(shù)與應(yīng)用
- 大學(xué)計(jì)算機(jī)應(yīng)用基礎(chǔ)
- INSTANT Autodesk Revit 2013 Customization with .NET How-to
- 計(jì)算機(jī)網(wǎng)絡(luò)安全
- Enterprise PowerShell Scripting Bootcamp
- MATLAB/Simulink權(quán)威指南:開(kāi)發(fā)環(huán)境、程序設(shè)計(jì)、系統(tǒng)仿真與案例實(shí)戰(zhàn)
- 傳感器與新聞
- Mastering Game Development with Unreal Engine 4(Second Edition)
- MCGS嵌入版組態(tài)軟件應(yīng)用教程
- 軟件構(gòu)件技術(shù)
- ZigBee無(wú)線通信技術(shù)應(yīng)用開(kāi)發(fā)
- 智能制造系統(tǒng)及關(guān)鍵使能技術(shù)
- 運(yùn)動(dòng)控制系統(tǒng)(第2版)
- 手把手教你學(xué)Photoshop CS3
- 漢字錄入技能訓(xùn)練