MongoDB authentication failed?

Nick Clifford

I'm currently trying to set up a secure MongoDB database for my various applications, but whenever I try to login with a username and password, but the shell always replies with Error: Authentication failed. and keeps me from accessing my database.

Errors from mongod --auth:

2016-02-12T17:11:57.039-0600 I ACCESS [conn1] SCRAM-SHA-1 authentication failed for app-client on application-userdata from client 127.0.0.1 ; UserNotFound Could not find user app-client@application-userdata

Can someone give me some help as to trying to make this work? I've already tried dropping and re-adding the user, but that does nothing. In case it matters, the user only has the readWrite role enabled.

(Ubuntu 15.10, x86_64)

Nick Clifford

Look at that, I figured it out. Turns out I had to change mongod.conf to enable authentication.

For those who are coming here in the future, add the following to /etc/mongod.conf:

security: authorization: enabled

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

MongoDB 3.2 authentication failed

From Dev

MongoDB-CR Authentication failed

From Dev

mongodb log4j2 authentication failed

From Dev

Configuring MongoDB connector in MuleStudio when authentication is disabled - "failed to connect" error

From Dev

Java MongoDB Client: authentication failed when access to a server not configured to use an authentication

From Dev

Golang and MongoDb remote access fail (server returned error on SASL authentication step: Authentication failed.)

From Dev

Java MongoDB Client: authentication failed when access to a server not configured to use an authentication

From Dev

FEDEX API, Authentication Failed

From Dev

Public Key authentication failed

From Dev

Authentication failed for user: null

From Dev

Authentication failed on the git remote

From Dev

Authentication failed for Azure Git

From Dev

Django authentication : CSRF Failed

From Dev

Failed NetSuite RESTlet authentication

From Dev

Mongolab Authentication Failed Java

From Dev

"Authentication failed" in Wayland application

From Dev

Authentication failed for user: null

From Dev

Mongoose throwing `Authentication failed`

From Dev

postgres ident authentication failed

From Dev

SmartGit Hg "Authentication Failed"

From Dev

Public Key authentication failed

From Dev

useradd PAM authentication failed

From Dev

SSH authentication failed

From Dev

Failed NetSuite RESTlet authentication

From Dev

Shiro Authentication failed

From Dev

MongoError: Authentication failed

From Dev

PayPal Client Authentication Failed

From Dev

LightDM: "Failed during authentication"

From Dev

ssh Authentication failed on Mac