k8s

harbor portal密码错误

问题:

harbor portal登录时报错密码错误
file

解决:

harbor目前使用的数据库是postgresql,不是mysql。

1.进入harbor-database pod

k get po -n harbor
k exec -it harbor-harbor-database-0 -n harbor -- bash

file

2.进入postgresql命令行

psql -U postgres -d postgres -h 127.0.0.1 -p 5432

file

3.切换到harbor数据库

\c registry

file

4.查询harbor用户

select * from harbor_user;

file

5.更改密码为Admin123

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

file
退出数据库。

\q
exit

6.清除浏览记录,重新登录仍然报错。

Error occurred in UserLogin: Failed to authenticate user, due to error ‘Invalid credentials’
查看harbor-core的日志。
file
查看harbor-portal的日志。
file

参考这个issue:https://github.com/goharbor/harbor-helm/issues/752
file
在数据库中执行。

update harbor_user set password_version='sha1' where user_id=1;   # 原来为sha256

file
file

7.再次登陆,成功!(可能是harbor修改了密码加密方式)

file

分类: k8s
0 0 投票数
文章评分
订阅评论
提醒
guest

0 评论
内联反馈
查看所有评论

相关文章

开始在上面输入您的搜索词,然后按回车进行搜索。按ESC取消。

返回顶部
0
希望看到您的想法,请您发表评论x