Page tree

如需转载请标注内容地址为: https://wiki.shileizcc.com/confluence/pages/viewpage.action?pageId=69140675

Skip to end of metadata
Go to start of metadata

请在使用站内资源的同时不要恶意进行爬取或倒链等行为,感谢支持!

Harbor 忘记密码

查看 harbor.yaml 中 database password 初始设置密码值,这里为 shileizcc.com。

进入容器:

$ docker exec -it harbor-db bash

进入 pg console 中,输入密码:

$ psql -h postgresql -d postgres -U postgres
Password for user postgres: 
psql (9.6.14)
Type "help" for help.

postgres=# 

切换数据库:

\c registry

查看 harbor user 表:

select * from harbor_user;
 user_id |      username       |         email         |             password             |    realname    |    comment     | deleted | reset_uuid |               salt               | sysadmin_flag |       creation_time        |        update_time         
---------+---------------------+-----------------------+----------------------------------+----------------+----------------+---------+------------+----------------------------------+---------------+----------------------------+----------------------------
       2 | anonymous           | anonymous@example.com |                                  | anonymous user | anonymous user | t       |            |                                  | f             | 2019-10-12 01:03:27.859411 | 2019-10-12 01:03:27.859411
       1 | admin               | admin@example.com     | a8b934db73bd78dd8871d30962e84810 | system admin   | admin user     | f       |            | ucw179rxipekk6kkl9madx1r2kv6029l | t             | 2019-10-12 01:03:27.859411 | 2019-10-15 03:22:23.795651
(2 rows)

修改密码 Harbor12345

update harbor_user set password='a71a7d0df981a61cbb53a97ed8d78f3e', salt='ah3fdh5b7yxepalg9z45bu8zb36sszmr'  where username='admin';

退出:

\q 
exit 

可以修改 admin 为其他名称,放置被攻击

update harbor_user set username='shileizcc' where user_id=1; 


文档创建于 最后一次更新于  , 文档当前的状态 正式版 , 当前编写页面的版本 V1.3.1 。

  • No labels