orientdb icon indicating copy to clipboard operation
orientdb copied to clipboard

accidently locked myself out from roles...

Open langhha opened this issue 10 years ago • 14 comments

OrientDB Version, operating system, or hardware.

  • v2.2.5

Operating System

  • Linux

Expected behavior and actual behavior

Grr, while experimenting, I accidently did the following command in the console:

orientdb> update ouser set roles = (SELECT FROM ORole WHERE name = 'voipadm')

(where this role 'voipadm' is a new one I was trying to setup) Now we are locked out from our database because all roles have been reset...

-> is there any way to recover the roles, without trashing my database contents ?

langhha avatar Aug 18 '16 14:08 langhha

If you use the server, you can access to the database with the server's credential (root).

lvca avatar Aug 18 '16 14:08 lvca

hey Luca, thx for your reply. I can indeed access the server (UNIX level) with UNIX credentials, and I can launch the console.sh, but from there is there any way I can reset the roles so that we can access the database again ?

langhha avatar Aug 19 '16 06:08 langhha

All you did was overwrite the role names of the users, right? If you can open a console, couldn't you run a couple of queries to reenter the correct roles under the default users?

Scott

smolinari avatar Aug 19 '16 08:08 smolinari

@rdelangh I meant OrientDB Server root credentials.

lvca avatar Aug 19 '16 09:08 lvca

@lvca no, server root credentials are not accepted when I try to connect to that database

langhha avatar Aug 19 '16 10:08 langhha

When you have installed the OrientDB Server, the first run it asks for the root password, right? To enter in the database (installed under the server "databases" directory) use "root" as user and the password you typed.

lvca avatar Aug 19 '16 11:08 lvca

@lvca yes indeed, that it exactly the password that I tried with user "root" to access this dbase, but not possible anymore.

langhha avatar Aug 19 '16 11:08 langhha

The server credentials bypass the database one. What's the error?

lvca avatar Aug 19 '16 12:08 lvca

root@thishost:~# /opt/orientdb/orientdb-community-2.2.5/bin/console.sh

OrientDB console v.2.2.5 (build 2.2.x@r393af9c5a3e4a4408440a9376283a26d2d3d3c7b; 2016-07-20 06:03:46+0000) www.orientdb.com Type 'help' to display all the supported commands. Installing extensions for GREMLIN language v.2.6.0

orientdb> connect remote:localhost/mydbase root rootpwd

Connecting to database [remote:localhost/mydbase] with user 'root'... Error: com.orientechnologies.orient.core.exception.OSecurityAccessException: User or password not valid for database: 'mydbase' DB name="mydbase" DB name="mydbase"

orientdb>

langhha avatar Aug 19 '16 14:08 langhha

It looks like the password is not correct. Try to reset it: http://orientdb.com/docs/last/Server-Security.html.

lvca avatar Aug 20 '16 14:08 lvca

@lvca Luca, sorry if I misunderstand that documentation, but it describes how to recover the 'admin' user for a database, using the 'root' user connected to this same database. But the issue I encounter is that the 'root' user itself can not longer connect to the database (see my previous post above).

langhha avatar Aug 22 '16 11:08 langhha

If you open the config/orientdb-server-config.xml file and remove the root user and the tag <isAfterFirstTime>true</isAfterFirstTime> at the end, on next restart of the server, a new root password is asked again. Use a password you can remember and than connect to the database with user = root and password = your password.

lvca avatar Aug 22 '16 12:08 lvca

ok Luca, that worked, thanks ! Now I can connect again to this database with user 'root', and also with the 'admin' user again. Case closed, many thanks for your help !!

langhha avatar Aug 22 '16 13:08 langhha

Cool.

lvca avatar Aug 22 '16 13:08 lvca