12

I'm root and I forgot it What can I do now?

I tried to reinstall arangodb, remove all databases but after new installation old password still exist

neuronet
  • 1,139
  • 8
  • 19

4 Answers4

13
service arangodb3 stop
/usr/sbin/arangod --server.authentication false

and then

require("@arangodb/users").replace("root", "my-changed-password");
exit
service arangodb3 restart // **VERY IMPORTANT STEP!!!**
//if you don't restart the server everyone can have access to your database
dothebart
  • 5,972
  • 16
  • 40
neuronet
  • 1,139
  • 8
  • 19
  • exactly - Once you started the server with disabled authentication, you can change the password. Please mark your own answer as 'accepted' ;-) – dothebart Jul 25 '16 at 11:29
  • This doesn't work, because `arangosh` is only the client tool, which is not allowed to disable the server's authentication. You have to start the **server** (arangod) with `--server.authentication false`. You don't need this startup option for arangosh, just connect to the server's endpoint and use a blank password. – CodeManX Jul 25 '16 at 11:34
  • but it worked, I changed the password this way (completely new one) and everything works fine, but now I cannot do this again because I have 401: Unauthorized weird... – neuronet Jul 25 '16 at 11:42
  • 1
    It worked because I have arangod stopped and then I run arangosh without authentication - it starts arangod without authentication for me so you are right – neuronet Jul 25 '16 at 11:45
7

Start the server arangod with the option --server.authentication false. This will disable authentication, so that you can access the databases without password. If you are asked for credentials in arangosh or the web interface, use root as username and a blank password. You can then change the password of user root (in the web interface: USERS > root > Change Password).

It is advisable to bind the server to --server.endpoint tcp://127.0.0.1:8529 and not 0.0.0.0 with authentication turned off, so that no one from outside can access the unprotected database, but only you locally on the server (you can also bind it to a network address, but make sure that the port is not open to the public in that case).

CodeManX
  • 11,159
  • 5
  • 49
  • 70
2

I'm running ArangoDB3 as a service on Ubuntu, and I wasn't able to figure out how to pass the --server.authentication false or --server.endpoint tcp://127.0.0.1:8529 parameters to the arangod process.

I made it work by changing the same values in /etc/arangodb3/arangod.conf.

Thomas Fauskanger
  • 2,536
  • 1
  • 27
  • 42
1

Step 1:- Stop running instance of arangodb

     sudo systemctl stop arangodb3

Step 2:- Start arangodb with disabled authentication

     sudo /usr/sbin/arangod --server.authentication false

Step 3:- Start arango shell in new terminal

     arangosh

Step 4 :- Change password of root in arango shell

     require("@arangodb/users").replace("root", "new-password");

Step 5 :- Close arango shell

     exit

Step 6 :- Stop arangodb unautheticated service in the previous terminal

     CTRL + c

Step 7 :- Restart arangodb service

     sudo systemctl start arangodb3
Sumit Kumar
  • 678
  • 4
  • 19