Harbor密码重置(Harbor平台报错 用户或密码不正确)

[root@master01 ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2147cfec7b25 goharbor/harbor-jobservice:v2.1.2 "/harbor/entrypoint.…" 10 minutes ago Up 10 minutes (healthy) harbor-jobservice
86cc4c52d979 goharbor/nginx-photon:v2.1.2 "nginx -g 'daemon of…" 10 minutes ago Up 10 minutes (healthy) 0.0.0.0:8081->8080/tcp, :::8081->8080/tcp nginx
7568dd41c106 goharbor/harbor-core:v2.1.2 "/harbor/entrypoint.…" 10 minutes ago Up 10 minutes (healthy) harbor-core
234bd1510f98 goharbor/redis-photon:v2.1.2 "redis-server /etc/r…" 10 minutes ago Up 10 minutes (healthy) redis
3ad11c06558c goharbor/registry-photon:v2.1.2 "/home/harbor/entryp…" 10 minutes ago Up 10 minutes (healthy) registry
bd0a1ed51604 goharbor/harbor-portal:v2.1.2 "nginx -g 'daemon of…" 10 minutes ago Up 10 minutes (healthy) harbor-portal
10559788f452 goharbor/harbor-registryctl:v2.1.2 "/home/harbor/start.…" 10 minutes ago Up 10 minutes (healthy) registryctl
532793ae81d7 goharbor/harbor-db:v2.1.2 "/docker-entrypoint.…" 10 minutes ago Up 10 minutes (healthy) harbor-db
45bc51de7b11 goharbor/harbor-log:v2.1.2 "/bin/sh -c /usr/loc…" 10 minutes ago Up 10 minutes (healthy) 127.0.0.1:1514->10514/tcp harbor-log

[root@master01 ~]# docker exec -ti 532793ae81d7 /bin/bash

进入pg数据库容器执行

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

postgres=# \c registry

registry=# update harbor_user set salt='', password='';
UPDATE 3
registry=# \q

退出容器

[root@master01 harbor]# docker-compose down
Stopping harbor-jobservice ... done
Stopping nginx ... done
Stopping harbor-core ... done
Stopping redis ... done
Stopping registry ... done
Stopping harbor-portal ... done
Stopping registryctl ... done
Stopping harbor-db ... done
Stopping harbor-log ... done
Removing harbor-jobservice ... done
Removing nginx ... done
Removing harbor-core ... done
Removing redis ... done
Removing registry ... done
Removing harbor-portal ... done
Removing registryctl ... done
Removing harbor-db ... done
Removing harbor-log ... done
Removing network harbor_harbor
[root@master01 harbor]# ./prepare
prepare base dir is set to /root/harbor
WARNING:root:WARNING: HTTP protocol is insecure. Harbor will deprecate http protocol in the future. Please make sure to upgrade to https
Clearing the configuration file: /config/portal/nginx.conf
Clearing the configuration file: /config/log/logrotate.conf
Clearing the configuration file: /config/log/rsyslog_docker.conf
Clearing the configuration file: /config/nginx/nginx.conf
Clearing the configuration file: /config/core/env
Clearing the configuration file: /config/core/app.conf
Clearing the configuration file: /config/registry/passwd
Clearing the configuration file: /config/registry/config.yml
Clearing the configuration file: /config/registry/root.crt
Clearing the configuration file: /config/registryctl/env
Clearing the configuration file: /config/registryctl/config.yml
Clearing the configuration file: /config/db/env
Clearing the configuration file: /config/jobservice/env
Clearing the configuration file: /config/jobservice/config.yml
Generated configuration file: /config/portal/nginx.conf
Generated configuration file: /config/log/logrotate.conf
Generated configuration file: /config/log/rsyslog_docker.conf
Generated configuration file: /config/nginx/nginx.conf
Generated configuration file: /config/core/env
Generated configuration file: /config/core/app.conf
Generated configuration file: /config/registry/config.yml
Generated configuration file: /config/registryctl/env
Generated configuration file: /config/registryctl/config.yml
Generated configuration file: /config/db/env
Generated configuration file: /config/jobservice/env
Generated configuration file: /config/jobservice/config.yml
loaded secret from file: /data/secret/keys/secretkey
Generated configuration file: /compose_location/docker-compose.yml
Clean up the input dir
[root@master01 harbor]# docker-compose up -d

posted @ 2022-09-23 16:37  beawh  阅读(431)  评论(0编辑  收藏  举报