Chef server password reset

我只是一个虾纸丫 提交于 2019-12-04 02:07:23
Draco Ater

I guess the only thing you can do now is to login into database itself and change the password there.

The database structure seems to have changed in Chef 12.2 or later, so based on your version you should use the following commands

(Before Chef 12.2)

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

(Chef 12.2 and above)

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

The new password for admin is "password". Login and change it through web interface.

If you have command line access to the server, then you can use chef-ctl

sudo chef-server-ctl password USERNAME

See here: https://docs.chef.io/ctl_chef_server.html#password

sudo chef-server-ctl password USERNAME

IMPORTANT to reset webui chef-manage-ctl restart

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!