MongoDB Key file generation

Source: Internet
Author: User
Tags base64 openssl file permissions

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

Generate a Key File

Overview

This section describes the 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 1024x768 characters and may only contain characters in the Base64 set. The key file must not has group or world permissions on UNIX systems. Key file permissions is not checked on Windows systems.


1, Create a key file.

Create The key file your deployment would use the Authenticate servers.

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


OpenSSL rand-base64 741 > Mongodb-keyfile

chmod mongodb-keyfile

Chown Mongod.mongod Mongodb-keyfile


Generate a key file using any method, you choose. Always ensure, 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.


This article is from the "Legendary Library sub" blog, please be sure to keep this source http://chason.blog.51cto.com/9078447/1601398

MongoDB Key file generation

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.