Chef 服务器密码重置

Chef server password reset

我在 linux 机器上安装并 运行 我自己的 Chef 服务器。当我访问我的厨师服务器 UI 时,它会询问我的用户名和密码。不幸的是我忘记了我的密码。我知道我的用户名是 admin

如何找回密码?在 UI 中也没有忘记密码选项。我更改了默认密码 p@ssw0rd1。但是我忘记了我改变了什么。

该密码是否存储在我的 Chef 服务器的任何位置,或者是否可以重置我的密码?谢谢

我想你现在唯一能做的就是登录数据库本身并在那里更改密码。

数据库结构似乎在 Chef 12.2 或更高版本中发生了变化,因此根据您的版本,您应该使用以下命令

(Chef 12.2 之前)

$ sudo -u opscode-pgsql  /opt/chef-server/embedded/bin/psql opscode_chef
psql# update osc_users set hashed_password = 'a$y31Wno2MKiGXS3FSgVg5UunKG48gJz0pRV//RMy1osDxVbrb0On4W' , salt ='a$y31Wno2MKiGXS3FSgVg5Uu' where username ='admin';

(Chef 12.2 及以上)

$ sudo -u opscode-pgsql  /opt/opscode/embedded/bin/psql opscode_chef
psql# update users set hashed_password = 'a$y31Wno2MKiGXS3FSgVg5UunKG48gJz0pRV//RMy1osDxVbrb0On4W' , salt ='a$y31Wno2MKiGXS3FSgVg5Uu' where username ='admin';

admin 的新密码是 "password"。通过网页界面登录修改。

如果您可以通过命令行访问服务器,那么您可以使用 chef-ctl

sudo chef-server-ctl password USERNAME

看这里:https://docs.chef.io/ctl_chef_server.html#password

sudo chef-server-ctl 密码用户名

重设 webui chef-manage-ctl restart 很重要