Question

I am a newbie getting started with couchbase-server. I simply want to browse the data present in a couchbase server using UI at http://www.dataoncouchbase.com:8091/index.html.

The password for the account "Administrator" is unknown. But I need to login to see the data.

  1. One technique for changing the administrator password on couchbase-server is the following command (I do have access to the machine via command line)

$$ /opt/couchbase/bin/couchbase-cli cluster-init -u Administrator -p old_password -c 127.0.0.1:8091 --cluster-init-username=Administrator --cluster-init-password=new_password

BUT...only works if you know the old password(which I don't have).

  1. I also tried modifying the local.ini file present at : /opt/couchbase/etc/couchdb/ and restarting the server. I added a new line(username=password) under [admins] section in the file. However I am not able to log in with the new user as well.

It would be great if someone can give me a way to add a new user(with read/write permissions) or change password for Administrator OR point me to some resource to do the same.

Was it helpful?

Solution 2

Have you looked in "config.dat" according to this it may appear there in plain text. (granted, they are talking about web console).

It seems like you may have already seen this but I'll reference it just in case. The format they use for password stored in local.ini includes spaces -> "username = password" Also they recommend running the command 'ls -alR /opt/couchbase-server/etc' to help figure out where your problem might be. Perhaps you can post your output for that command here if the last two suggestions don't work out.

OTHER TIPS

cbreset_password - it'll reset Administrator password w/o need to know the prior.

I had the same problem. Seems like there's no way to reset the password, but it is visible in the config.dat file. The other thing that caught me out is the username...it's case sensitive, so Admin != admin !!!

If you know the old password ( I know this is not your case, but I want to write the solution to help someone who knows old password), you should read:

I changed with this command ( although it has thrown error --> ERROR: option cluster-init-ramsize is not specified);

./couchbase-cli cluster-init -c 127.0.0.1:8091 --user=admin --password=OLDPASS --cluster-init-username=admin --cluster-init-password=NEWPASS

My configuration is;

CentOs Gnu/Linux & Couchbase 2.5.0

I have run command under the directory: /opt/couchbase/bin

Ok man I figured it out :) I use OSX but I guess the way will be simular.

I went into the CouchbaseServer.app in orde to view the content. then you open the folder Content/Resources/couchbase-core/bin and theres programm called cbreset_password :)

Then it asked you to change the admin password.....there you go.

I feel with you it took me 2 hours :)

Using couchsync with couchbase you can change all users password using the administrative REST API.

curl -vX PUT http://127.0.0.1:4985/yourdbname/_user/youruser --data "{"name":"youruser", "password":"newpassword", "admin_channels":["yourlistofchannels"], "admin_roles":["yourlistofroles"]}"

Using your command go to your Couchbase bin folder. For mac, this is /Applications/Couchbase Server.app/Contents/Resources/couchbase-core/bin

In that folder, execute this: ./couchbase-cli reset-admin-password --new-password test123. Your new password will be changed to test123.
enter image description here

Here is the detailed guide: https://docs.couchbase.com/server/4.6/cli/cbcli/reset-admin-password.html

Step1:

/opt/couchbase/bin/couchbase-cli reset-admin-password  --new-password 'Pass@2020'
-------
SUCCESS
-------

You may be trying to login with username "Administrator" but you will see error sometimes. Because in some clusters "Administrator" may not be the default hard coded admin, to see the admin name see the below file (as follows):

$ ls -lrth /opt/couchbase/var/lib/couchbase/isasl.pw 
$ cp /opt/couchbase/var/lib/couchbase/isasl.pw /tmp
$ cat /tmp/isasl.pw

    {
      "users": [
        {
          "n": "**Admin**",

  ------------------here "Admin" is the Administrator account. So use "Admin" as username to login with your new password changed in step1.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top