Forgot mongodb admin database credentials. Reset everything - mongodb

I forgot the credentials of my admin user.
Hence i am not able to connect to cluster mongo shell.
Now i want to delete all users and and credentials or even if reset of mongodb is possible then it will be a lot help.
I tried following commands but got "authentication required error".
db.createUser(), db.dropDatabase().
I expect to create new admin user with credentials.

you can do it by logging in to your Atlas Cluster here: https://www.mongodb.com. Then, on the left sidebar, you click on 'Database Access'. There you can manage the users and you can even delete them and create new ones.

Related

PG Admin 4 (WEB) and inititail logon as user postgress without password

I have a fresh install of a database on AWS. I have installed PG Admin 4 for Web and set up for a user login. This works.
I find it is not possible to connect to the localhost database using 'postgres' as a user, without a password. This appears to be enforced by the dialog. Is there a way around this enforcement? How would a user only having web access ALTER this ROLE? I would expect this to be relaxed for the initial login.
The database is local to the webserver and the web server is remote for the user.
TL:DR This logon is not a peer logon as the postgres *nix user.
It's a gap in the install. A manual step will always be required to add a password for postgres for anyone wanting to use the interface for initial USER/ROLE creation. It would be nice to have had this opportunity in the setup script.
I suppose it is expected that most administrators would also add other users/roles at this time and these would be supplied to the users. Changes to config files would still be managed. They are not getting shell access.

cannot connect to mongo cluster - user is not allowed to do action [getLog] on [admin.]

I have created a user and added my IP to whitelist.
when trying to connect to a cluster through mongo shell, i am required to enter the following line: mongo "mongodb+srv://cluster0.****.mongodb.net/" --username --password
I have filled in credentials for username and password and replaced dbname with my database name(tried using non-existing one as well in case that was the problem). it connects to the shell, but then crashes with the following error:
Error while trying to show server startup warnings: user is not allowed to do action [getLog] on [admin.]
MongoDB Enterprise atlas-7cwf8s-shard-0:PRIMARY>
tried googling and youtubing the issue, but cannot find the match on how to fix it.
Many thanks
That message says that the shell is unable to show you server startup warnings. It's expected in Atlas environment.
Supposing that's your own cluster, then:
Check the user in Atlas > Database Access
Check the MongoDB Roles header in the table.
If it's not atlas Admin, you can't issue this command:
db.adminCommand({getLog:"startupWarnings"})
Or any admin command, which is issued or tested automatically in the connection, hence the error.
Edit MongoDB Roles to the highest privileges (atlas Admin)
But you can still work anyways.
If you're accessing someone else's cluster, then there isn't much to do.

What are "system managed users" in DocumentDB?

We have a cluster in AWS, with a Document DB up and running. I wanted to grant some extra privileges, so I connected to the database as an user with the root role granted, and did the usual MongoDB thing:
db.grantRolesToUser("nameOfTheUser", ["readWrite"])
Instead of just granting the privileges, it gave me:
2020-05-04T15:26:42.053+0000 E QUERY [js] uncaught exception: Error: Cannot update system managed users' roles :_getErrorWithCode#src/mongo/shell/utils.js:25:13
DB.prototype.grantRolesToUser#src/mongo/shell/db.js:1592:15
#(shell):1:1
This is the first time I hear about any system managed users. I searched both MongoDB and AWS DocumentDB docs, but didn't find it anywhere. What are they? How an user ends up being system managed? And how can I change their privileges?
The serviceadmin user is created implicitly when the cluster is created. Every Amazon DocumentDB cluster has a serviceadmin user that provides AWS the ability to manage your cluster. You cannot log in as, drop, rename, change the password, or change the permissions for serviceadmin. Any attempt to do so results in an error.
Please see the following for more information: https://docs.aws.amazon.com/documentdb/latest/developerguide/security.managing-users.html

CKAN systemadmin user and password

I installed for the first time on my OS X CKAN (And is possible ive made some mistake). Now i want to play with the UI backend but when I go in "login" section it ask me for User/password
I'm using my postgres user and user's password for access it but it give me error.
If I list the db I can see my user there but when I login it say "user doesn't exist"
So which one is the CKAN Systemadmin access?
Reading in the docs it just say, you shoudl have create this user during installation process
you can run this paster command to create a sysadmin user:
paster --plugin=ckan sysadmin add <username> --config=/etc/ckan/development.ini
For more, see http://docs.ckan.org/en/latest/maintaining/paster.html

not able to connect to mongodb because of unauthorized lock type

I am trying to connect to my mongodb deployed in jelastic cloud
If i try to use the test database already provided in the mongodb node in jelastic..it works fine.But if i create my own database and try to access the collections created in it ..i get the following exception
com.mongodb.MongoException: unauthorized db:appdb lock type:-1 client:192.168.1.53
Why is this happening?how can i resolve it?
I am reading the configuration from a file mydb.cfg
host=mongodb-***.jelastic.servint.net
dbname=appdb
user=admin
password=*****
When in Rock Mongo web interface pick the targeted db and go for 'More' in config panel.
This has to show you the list of users having rights for DB.
Did you set the user and rights for your custom collection?
Try to check the configuration under 'Authentication' section?
Anyway, supposedly admin user should have rights to all DBs. You can try to figure this issue out at Jelastic community
I had the same issue when connection to mongodb custom named database.
In order to succeed with the connection, I have created an user for my custom named database.
(I added the provided admin user with its password to the authorized users as the image shown).