Harbor正确密码登录不上去
[root@hub harbor]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
cf5d0df2935f goharbor/nginx-photon:v1.10.11 "nginx -g 'daemon of…" 10 days ago Up 4 hours (healthy) 0.0.0.0:80->8080/tcp, 0.0.0.0:443->8443/tcp nginx
5f373c689525 goharbor/harbor-jobservice:v1.10.11 "/harbor/harbor_jobs…" 10 days ago Up 5 seconds (health: starting) harbor-jobservice
242b4f35f322 goharbor/harbor-core:v1.10.11 "/harbor/harbor_core" 10 days ago Restarting (2) 38 seconds ago harbor-core
6fc46205eccb goharbor/harbor-registryctl:v1.10.11 "/home/harbor/start.…" 10 days ago Up 4 hours (healthy) registryctl
8ca6e340e8b5 goharbor/harbor-db:v1.10.11 "/docker-entrypoint.…" 10 days ago Up 4 hours (healthy) 5432/tcp harbor-db
42f03bcc4fb8 goharbor/harbor-portal:v1.10.11 "nginx -g 'daemon of…" 10 days ago Up 4 hours (healthy) 8080/tcp harbor-portal
0647d52988cf goharbor/registry-photon:v1.10.11 "/home/harbor/entryp…" 10 days ago Up 4 hours (healthy) 5000/tcp registry
229aa32bbc70 goharbor/harbor-log:v1.10.11 "/bin/sh -c /usr/loc…" 10 days ago Up 4 hours (healthy) 127.0.0.1:1514->10514/tcp harbor-log
找到harbor-db
[root@hub harbor]# docker exec -it 8ca6e340e8b5 /bin/bash
postgres [ / ]$ psql -h postgresql -d postgres -U postgres
Password for user postgres:
psql (9.6.24)
Type "help" for help.
postgres=# \c registry
You are now connected to database "registry" as user "postgres".
registry=# select * from harbor_user;
user_id | username | email | password | realname | comment | deleted | reset_uuid | salt | sysadmin_flag | creation_time | update_time | p
assword_version
---------+-----------+-------+----------------------------------+----------------+----------------+---------+------------+----------------------------------+---------------+----------------------------+----------------------------+--
----------------
2 | anonymous | | | anonymous user | anonymous user | t | | | f | 2022-05-26 10:47:32.927028 | 2022-05-26 10:47:33.890743 | s
ha1
1 | admin | | 54c62fc210ea5a503b2993e6549d8551 | system admin | admin user | f | | pwebho64mmi20n5cqna8p4kimo9f9870 | t | 2022-05-26 10:47:32.927028 | 2022-05-26 10:47:34.235676 | s
ha256
(2 rows)
registry=# update harbor_user set password='a71a7d0df981a61cbb53a97ed8d78f3e', salt='ah3fdh5b7yxepalg9z45bu8zb36sszmr', password_version='sha1' where username='admin';
UPDATE 1
registry=# select * from harbor_user;
user_id | username | email | password | realname | comment | deleted | reset_uuid | salt | sysadmin_flag | creation_time | update_time | p
assword_version
---------+-----------+-------+----------------------------------+----------------+----------------+---------+------------+----------------------------------+---------------+----------------------------+----------------------------+--
----------------
2 | anonymous | | | anonymous user | anonymous user | t | | | f | 2022-05-26 10:47:32.927028 | 2022-05-26 10:47:33.890743 | s
ha1
1 | admin | | a71a7d0df981a61cbb53a97ed8d78f3e | system admin | admin user | f | | ah3fdh5b7yxepalg9z45bu8zb36sszmr | t | 2022-05-26 10:47:32.927028 | 2022-06-07 01:11:56.969128 | s
ha1
(2 rows)
registry=#
registry=# \q
postgres [ / ]$ exit
exit
[root@hub harbor]# docker restart harbor-core
harbor-core
原因:assword_version加密版本错了,重置密码并将sha256改成sha1
再次输入账户admin,密码Harbor12345,登录成功