How can I access my MongoDB on my Linode VPS?

Solution 1:

You gave your user readWrite role, but that role doesn't allow execution of command dropDatabase, only the dbAdmin role can do that. See the available built-in roles here: https://docs.mongodb.com/manual/reference/built-in-roles/

Ideally, you'd create yourself a custom role with all the necessary privileges required, and assign that role to your application's user. More info on user-defined roles here: https://docs.mongodb.com/manual/core/security-user-defined-roles/