Harbor 忘记密码

Harbor密码重置

01,登入到harbor容器里面的数据库上

docker exec -it harbor-db /bin/bash

02,登入数据库

 psql -h postgresql -d postgres -U postgres  #这要输入默认密码:root123 。
 psql -U postgres -d postgres -h 127.0.0.1 -p 5432  #或者用这个可以不输入密码

03,切换所在的数据库

\c registry

04,查看所在的表

registry=# 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-03-02 14:52:45.35286 | 2019-03-02 14:52:45.35286
       1 | admin     | admin@example.com     | 460820e7ee507187f9c983b29d1a26ef | system admin   | admin user     | f       |            | cyssusxekqdqgyru7dr9naywrzztxzmv | t             |
 2019-03-02 14:52:45.35286 | 2019-03-02 14:52:45.670482
(2 rows)

05,修改密码

重新修改为默认的密码

 update harbor_user set password='e7c0331ebb021d64713c0515f6dad38f', salt='pa4mmop0v9lhnv2vpvmkuv941it72ku6'  where username='admin';

这个为用户admin,密码Admin123

06,退出 \q 退出postgresql,exit退出容器

registry=# update harbor_user set password='e7c0331ebb021d64713c0515f6dad38f', salt='pa4mmop0v9lhnv2vpvmkuv941it72ku6'  where username='admin';
UPDATE 1
registry=# \q
root [ / ]

 还是不成功的话就重启下docker或者harbor就行了

  

posted on 2019-10-08 10:52  kingle-l  阅读(6326)  评论(1编辑  收藏  举报

levels of contents