cassandracassandra-2.0

How to reset a lost Cassandra admin user's password?


I have full access to the Cassandra installation files and a PasswordAuthenticator configured in cassandra.yaml. What do I have to do to reset admin user's password that has been lost, while keeping the existing databases intact?


Solution

  • Solved with the following steps:

    1. Change authenticator in cassandra.yaml to AllowAllAuthenticator and restart Cassandra
    2. cqlsh
    3. update system_auth.credentials set salted_hash='$2a$10$vbfmLdkQdUz3Rmw.fF7Ygu6GuphqHndpJKTvElqAciUJ4SZ3pwquu' where username='cassandra';
    4. Exit cqlsh
    5. Change authenticator back to PasswordAuthenticator and restart Cassandra

    Now you can log in with

    cqlsh -u cassandra -p cassandra
    

    and change the password to something else.