如何重置丢失的 Cassandra 管理员用户密码? [英] How to reset a lost Cassandra admin user's password?

查看:28
本文介绍了如何重置丢失的 Cassandra 管理员用户密码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以完全访问 Cassandra 安装文件和在 cassandra.yaml 中配置的 PasswordAuthenticator.我该怎么做才能重置丢失的管理员用户密码,同时保持现有数据库完好无损?

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?

推荐答案

通过以下步骤解决:

  1. cassandra.yaml 中的身份验证器更改为 AllowAllAuthenticator 并重新启动 Cassandra
  2. cqlsh
  3. update system_auth.credentials set salted_hash='$2a$10$vbfmLdkQdUz3Rmw.fF7Ygu6GuphqHndpJKTvElqAciUJ4SZ3pwquu' where username='cassandra';
  4. 退出cqlsh
  5. 将身份验证器更改回 PasswordAuthenticator 并重新启动 Cassandra
  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

现在您可以使用

cqlsh -u cassandra -p cassandra

并将密码更改为其他内容.

and change the password to something else.

这篇关于如何重置丢失的 Cassandra 管理员用户密码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆