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就行了

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM