How do I reset the password for Couchbase web administrative console?

I forgot the password for the web console. How do I reset the password? I am on Windows.

Acutally the password seems to be saved in plain text in config.dat file! Is this really a good practice?

The file’s permissions only allow authorized users to view it. We agree though that it should be stored with stronger security. There is an open issue on this.

The password can be changed using the couchbase-cli tool.

shell> ./couchbase-cli cluster-init -c 127.0.0.1:8091 --user=[CURRENT_USERNAME] --password=[CURRENT_PASSWORD] --cluster-init-username=[NEW_USERNAME] --cluster-init-password=[NEW_PASSWORD]
SUCCESS: init 127.0.0.1

More details about the couchbase-cli tool can be found here: http://www.couchbase.com/docs/couchbase-manual-1.8/couchbase-admin-cmdline-couchbase-cli.html

Dipti: changing the password is different from resetting it though. I thought that’s what was being asked about.

We currently don’t have a way to reset the password using cli. We have an enhancement request open.

One current workaround is to stop the current server, copy out (or just cp -l) data files, uninstall, install, set up, cp -l data files back and create again the same bucket(s). It will honor the data files there.

Hi,
i have tried that and looks like they read a command like bash. Here is the output

./couchbase-cli cluster-init -c localhost:8091 --user=Administrator --password=c3nt0s!2345 --cluster-init-username=administrator --cluster-init-password=golive
-bash: !2345: event not found

Please help me regarding this…is my command is right? or is it not?

You’ll probably need to escape that ‘!’ in your password.

Path: /opt/couchbase/bin
Command:

./erl -noinput -eval ‘case file:read_file("/opt/couchbase/var/lib/couchbase/config/config.dat") of {ok, B} -> io:format("~p~n", [binary_to_term(B)]) end.’ -run init stop | grep cred

{rest_creds,
{creds,[{“a”,[{password,“passwd”}]}]}]},

userid is "a"
password is “passwd”

I confirm that the Dipti’s command works well !

./erl -noinput -eval ‘case file:read_file("/opt/couchbase/var/lib/couchbase/config/config.dat") of {ok, B} -> io:format("~p~n", [binary_to_term(B)]) end.’ -run init stop | grep cred

Thanks a lot, it helps us a lot :slight_smile:

Best

seems to fail on cb 3.0

$ ./erl -noinput -eval 'case file:read_file("/opt/couchbase/var/lib/couchbase/config/config.dat") of {ok, B} -> io:format("~p~n", [binary_to_term(B)]) end.' -run init stop | grep cred

get :

init terminating in do_boot ()

You can use cbreset_password tool located in $CBDIRECTORY/bin (e.x./opt/couchbase/bin). You need to be a superuser to do so.

How do I reset pwd if the couch base is installed in a docker container?

You should be able to CD… in to the server/bin/cbpassword reset tool and reset it from there.