harbor icon indicating copy to clipboard operation
harbor copied to clipboard

Questions about changing the harbor user password to a fixed value

Open pptfz opened this issue 1 year ago • 3 comments

I looked at the information about the test user and got the salt value

registry=# select * from harbor_user where username='test';
-[ RECORD 1 ]----+---------------------------------
user_id          | 5
username         | test
email            | [email protected]
password         | 73c64d8db1d03e6b94cecc1fc3e9f1fe
realname         | test
comment          | 
deleted          | f
reset_uuid       | 
salt             | QLFb3LbuIO6I8q7ou92LFH450GZTdPfC
sysadmin_flag    | f
creation_time    | 2024-09-29 07:15:46.561826
update_time      | 2024-09-29 07:15:46.561828
password_version | sha256

Now I want to change the password of the test user to the specified value, but this does not work What kind of password encryption should I use? md5sum sha256?

echo -n 'www.google.comQLFb3LbuIO6I8q7ou92LFH450GZTdPfC' | md5sum | awk '{ print $1 }'
733a9e49f1f5177d2bdf8115dbdaf426

update harbor_user set salt='QLFb3LbuIO6I8q7ou92LFH450GZTdPfC', password='733a9e49f1f5177d2bdf8115dbdaf426' where username = 'test';

pptfz avatar Sep 29 '24 07:09 pptfz

Why are you updating the password directly through the database instead of using the Harbor API?

wy65701436 avatar Sep 30 '24 04:09 wy65701436

Forget the password of user admin, so you need to change it in the database

pptfz avatar Sep 30 '24 06:09 pptfz

Please refer to this wiki https://github.com/goharbor/harbor/wiki/Harbor-FAQs#authentication for reset admin password. Then change the normal user password via api/ui

MinerYang avatar Oct 14 '24 08:10 MinerYang

This issue is being marked stale due to a period of inactivity. If this issue is still relevant, please comment or remove the stale label. Otherwise, this issue will close in 30 days.

github-actions[bot] avatar Dec 13 '24 09:12 github-actions[bot]

This issue was closed because it has been stalled for 30 days with no activity. If this issue is still relevant, please re-open a new issue.

github-actions[bot] avatar Jan 13 '25 09:01 github-actions[bot]