MongoDB Questions and Answers – Access Control

«
»

This set of MongoDB Multiple Choice Questions & Answers (MCQs) focuses on “Access Control”.

1. If you create the user administrator before enabling access control, MongoDB disables the ________ exception.
a) localhost
b) server
c) runtime
d) none of the mentioned
View Answer

Answer: a
Explanation: The localhost exception allows you to enable authorization before creating the first user in the system.

advertisement

2. Point out the correct statement.
a) After you create the user administrator, the localhost exception is no longer available
b) Enabling access control on a MongoDB instance restricts access to the instance by requiring that users identify themselves when connecting
c) The mongo shell executes a number of commands at start up
d) All of the mentioned
View Answer

Answer: d
Explanation: As a result, when you log in as the user administrator, you may see authentication errors from one or more commands.

3. If you use the localhost exception when deploying a new MongoDB system, the first user you create must be in the ________ database.
a) head
b) local
c) admin
d) all of the mentioned
View Answer

Answer: c
Explanation: In the case of a sharded cluster, the localhost exception applies to each shard individually as well as to the cluster as a whole.

advertisement
advertisement

4. If you need to disable access control for any reason, restart the process with ______ setting.
a) KeyFile
b) Authentication
c) Authorization
d) All of the mentioned
View Answer

Answer: a
Explanation: Login in with the user administrator’s credentials and create additional users.

5. Point out the wrong statement.
a) Authentication does not require an authentication mechanism
b) To enable authentication on a sharded cluster, you must enable authentication individually on each component of the cluster
c) The content of the key file must be the same on all cluster members
d) All of the mentioned
View Answer

Answer: a
Explanation: Authentication requires an authentication mechanism and, in most cases, a key file.

advertisement

6. The ________ client authentication allows clients to authenticate to servers with certificates rather than with a username and password.
a) x.209
b) x.509
c) x.709
d) None of the mentioned
View Answer

Answer: b
Explanation: MongoDB supports x.509 certificate authentication for use with a secure TLS/SSL connection.

7. enableLocalhostAuthBypass is not available using _________ database command.
a) setParameter
b) enableParameter
c) removeParameter
d) none of the mentioned
View Answer

Answer: a
Explanation: Use the setParameter option in the configuration file or the –setParameter option on the command line.
advertisement

8. ______________ enables a set of internal commands useful for internal testing operations.
a) enableTestAll
b) enableTest
c) enableTestCommands
d) all of the mentioned
View Answer

Answer: c
Explanation: enableTestCommands is only available when starting mongod and you cannot use setParameter to modify this parameter.

Sanfoundry Global Education & Learning Series – MongoDB.

advertisement

Here’s the list of Best Reference Books in MongoDB.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

advertisement
advertisement
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer & SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage, Advanced C Programming, SAN Storage Technologies, SCSI Internals & Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him @ LinkedIn | Youtube | Instagram | Facebook | Twitter