Loading

×Sorry to interrupt
This page has an error. You might just need to refresh it.
[NoErrorObjectAvailable] Uncaught ReferenceError: addCTracking is not defined
Failing descriptor: {markup://c:KM_ArticleThemeLayout}

Refresh

Cookie Preference Center

General Information on cookies

When you visit our website, we use cookies to ensure that we give you the best experience. This information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies by clicking on the different category headings to find out more and change your settings. However, blocking some types of cookies may impact your experience on the site and the services we are able to offer. Further information can be found in our

Cookie Policy.

Strictly Necessary

Strictly Necessary

Always Active

Strictly Necessary

Strictly necessary cookies are always enabled since they are essential for our website to function. They enable core functionality such as security, network management, and website accessibility. You can set your browser to block or alert you about these cookies, but this may affect how the website functions. For more information please visit www.aboutcookies.org or www.allaboutcookies.org.

Cookie Details‎

Performance

Performance

Performance

Performance cookies are used to analyze the user experience to improve our website by collecting and reporting information on how you use it. They allow us to know which pages are the most and least popular, see how visitors move around the site, optimize our website and make it easier to navigate.

Cookie Details‎

Please confirm your settings by refreshing the page.

Functional

Functional

Functional

Functional cookies help us keep track of your past browsing choices so we can improve usability and customize your experience. These cookies enable the website to remember your preferred settings, language preferences, location and other customizable elements such as font or text size. If you do not allow these cookies, then some or all of these services may not function properly.

Cookie Details‎

Advertising

Advertising

Advertising

Advertising cookies are used to send you relevant advertising and promotional information. They may be set through our site by third parties to build a profile of your interests and show you relevant advertisements on other sites. These cookies do not directly store personal information, but their function is based on uniquely identifying your browser and internet device.

Cookie Details‎

Advertising Cookies

Consent Leg.Interest

Select All Vendors

Select All Vendors

Select All Hosts

Select All

Clear Filters

Information storage and access

Apply

Confirm My Choices Reject All Allow All

My Subscriptions

Loading

Knowledge Base

How to reset and retrieve forgotten Harbor admin password (76289)

Last Updated: 1/7/2020Categories: How toTotal Views: 30185Language:
English

16 like this article

Subscribe to get an email
newsletter with new updates

16 people found this helpful Please provide article feedback:

Purpose

This article helps you to retrieve or reset the Harbor admin password in below scenarios:

You forgot the Harbor admin password configured initially during the Harbor tile deployment.

You have updated the admin password from Harbor UI and forgot it.

Resolution

To retrieve the admin password configured initially during the deployment of Harbor tile vm:

Log in to Harbor instance by running:
bosh -d harbor-container-registry-xxxxxxxxxxxxxxxxxxxx ssh

Provide root privileges by running sudo -i.

Set the docker environment alias by running the below command:
alias docker='/var/vcap/packages/docker/bin/docker -H unix:///var/vcap/sys/run/docker/dockerd.sock'

Run docker ps and make a note of the harbor-adminserver or harbor-core container id.

Harbor version <=1.7: docker exec to the harbor-adminserver container

Harbor version >=1.8: docker exec to the harbor-core container

For example:
docker exec -it 0874fd181f8b bash
where 0874fd181f8b is the respective CONTAINER ID

Run env and make a note of HARBOR_ADMIN_PASSWORD.

Note: This is the admin password configured during initial harbor tile vm deployment. This entry does not get updated if the password is changed later from Harbor GUI.

To reset the admin password that was updated from Harbor UI and forgotten:

If the administrator have changed the harbor admin password from GUI and forgot it later, follow the below steps to reset back to the initial configured one.
Note: The below steps are going to modify the harbor database and need to be performed with caution. If you need help with these steps, please file a Support Request with VMware support.

Run docker ps and confirm that all the containers are running.

Login to the harbor-db container by running the following command:
docker exec -it harbor-db bash

Connect to the database by running  the following commands:
psql -U postgres -d registry

Run the below command to list the harbor users:
select * from harbor_user;
Note: Make a note of the admin user_id for the next step

Run the below command to reset the admin password
update harbor_user set salt='', password='' where user_id = 1;
Note: This will set the admin password back to what it was initially configuring during harbor tile vm deployment.

Exit from the db and container by running \q.

Restart Harbor service by running:
monit restart harbor

Detectable by VMware SkylineTM

Actions

Copy

link to clipboard
copied!

Print

Language:
English

Attachments

Additional Resources

KB
•
データベースのフェイルオーバー イベント後に一部のサービスを復旧できない問題を解決するための vRA 8.0.0 HA 環境用のパッチ (76222)

KB
•
VMware HCX Enterprise アプライアンスで ntpq コマンドを実行すると、リクエストがタイムアウトする (76290)

KB
•
在 vRealize Automation 7.x 中禁用 Internet Information Services (IIS) 应用程序池回收 (76333)

KB
•
[VMC on AWS] MOB を使用してロールを作成、更新、および削除する (76210)

Results 1-4 of 4

Ask The Community

Get answers quickly from VMware experts in the community

Post Subject

CONTINUE IN COMMUNITIES

Related Products:

Related Versions:

VMware PKS 1.x

Take Our Survey

Support Assistant