Presuming you have access to the Sourcegraph Docker container and the container name is sourcegraph
:
- Get the id for the admin account (should be 1 in most cases):
docker container exec sourcegraph psql -U postgres sourcegraph -c 'SELECT id, username, passwd FROM users'
- Set the
$ID
variable:
ID='VALUE'
-
Go to https://bcrypt-generator.com/ and generate a hash with Rounds set to
10
. -
Set the
$HASH
variable (surround with single quotes):
HASH='VALUE'
- Execute the SQL query to update the
users
database table with the new password:
docker container exec sourcegraph psql -U postgres sourcegraph -c "UPDATE users SET passwd_reset_code=NULL, passwd_reset_time=NULL, passwd='${HASH}' WHERE id=${ID};"