Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questions about changing the harbor user password to a fixed value #20977

Open
pptfz opened this issue Sep 29, 2024 · 2 comments
Open

Questions about changing the harbor user password to a fixed value #20977

pptfz opened this issue Sep 29, 2024 · 2 comments

Comments

@pptfz
Copy link

pptfz commented Sep 29, 2024

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';
@wy65701436
Copy link
Contributor

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

@pptfz
Copy link
Author

pptfz commented Sep 30, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants