Unable to authenticate to MongoDb if attempting remotely

Hi @Saylent_N_A, welcome to the forums.

Server logging should also show any failure reasons, search/filter on "c":"ACCESS".

A user can be created to include extra authentication restrictions on the client ip address(es) and server ip address(es).

Use the db.getUser('username', {showAuthenticationRestrictions:true}).authenticationRestrictions command to list any.

// example
db.getUser('foo',{showAuthenticationRestrictions:1}).authenticationRestrictions
[ { clientSource: [ '127.0.0.1/8', '192.168.1.1/24' ] } ]

Another possibility us that the port is being forwarded to another mongodb instance?

2 Likes