Chef server password reset

I installed and run my own Chef server in my Linux machine. When I access the chef's user interface, I ask for my username and password. Sorry, I forgot my password. I know my username is admin .

How to recover a password? The user interface also does not have a password. I changed the default password, which is p@ssw0rd1 . But I forgot what I changed.

Is this password stored anywhere in my chef server or is it still in reset my password? Thanks.

+8
chef
source share
3 answers

I think the only thing you can do now is enter the database 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 the cook 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 the administrator is "password". Log in and change it through the web interface.

+7
source share

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

sudo password chef-server-ctl USERNAME

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

+9
source share

sudo password chef-server-ctl USERNAME

IMPORTANT to reset webui reboot chef-manage-ctl

+1
source share

All Articles