I installed and run my own Chef server in my linux machine. When I access my chef server UI it ask me username and password. Unfortunately I forgot my password. I know my user name is admin
.
How can I recover my password? In the UI there is no forgot password option also. I changed the default password which is p@ssw0rd1
. But I forgot what I have changed.
Is that password is stored in any location of my chef server or Is that anyway to reset my password? Thanks.
On each Chef Server there is a Status endpoint located at https://fqdn/_status. It pings the various systems needed for your Chef Server to be healthy and if any return an erroneous response, it will return a HTTP 500 error to the requestor.
Currently, self-service deletion of Hosted Chef organizations is not possible. However, feel free to submit a ticket at [email protected] with the short name of your organization (the one that appears in URLs like https://api.opscode.com/organizations/humptydumpty) and we will help you clean up.
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.
sudo chef-server-ctl password USERNAME
IMPORTANT to reset webui chef-manage-ctl restart
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With