mongodb Key File文件生成

发布时间:2020-06-20 18:53:18 作者:传奇库子
来源:网络 阅读:2838

参考:http://docs.mongodb.org/manual/tutorial/generate-key-file/

Generate a Key File

Overview

This section describes how to generate a key file to store authentication information. After generating a key file, specify the key file using the keyFile option when starting a mongod or mongos instance.

A key’s length must be between 6 and 1024 characters and may only contain characters in the base64 set. The key file must not have group or world permissions on UNIX systems. Key file permissions are not checked on Windows systems.


1、Create a key file.

Create the key file your deployment will use to authenticate servers to each other.

To generate pseudo-random data to use for a keyfile, issue the following openssl command:


openssl rand -base64 741 > mongodb-keyfile

chmod 600 mongodb-keyfile

chown mongod.mongod mongodb-keyfile


You may generate a key file using any method you choose. Always ensure that the password stored in the key file is both long and contains a high amount of entropy. Using openssl in this manner helps generate such a key.


2、Specify the key file when starting a MongoDB instance.

Specify the path to the key file with the keyFile option.


推荐阅读:
  1. mongodb索引
  2. mongoDB副本集的搭建

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

mongodb keyfile __file__

上一篇:Laravel源码分析:Response

下一篇:通过php base64函数进行加密解密

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》