Nexus3 重置密码

本文最后更新于 2025年5月24日 晚上

nexus3 reset password

  1. 启用 h2 数据库 http 界面
    $datadir/etc/nexus.properties(/nexus-data)增加配置
1
2
nexus.h2.httpListenerEnabled=true
nexus.h2.httpListenerPort=1234
  1. 映射 1234 端口到主机端口,重启服务
  2. 配置 1234 端口 ssh 映射
1
ssh -L 1234:192.168.1.10:1234 user@192.168.1.10
  1. 访问 http://localhost:1234,使用配置连接
1
2
3
4
Driver: org.h2.Driver
JDBC URL: jdbc:h2:file:nexus
username: <LEAVE BLANK>
password: <LEAVE BLANK>
  1. 查找 admin 用户记录,更新为默认密码admin123
1
2
3
select * from security_user where id='admin';

update security_user SET password='$shiro1$SHA-512$1024$NE+wqQq/TmjZMvfI7ENh/g==$V4yPw8T64UQ6GfJfxYq2hLsVrBY8D1v+bktfOxGdt4b/9BthpWPNUy/CBk6V9iA0nHpzYzJFWO8v/tZFtES8CA==', status='active' WHERE id='admin';
  1. nexus.properties恢复默认配置,重启服务

参考

  1. How to reset nexus admin password in Nexus 3 OSS
  2. How to reset a forgotten admin password in Sonatype Nexus Repository 3

Nexus3 重置密码
https://blog.cook369.xyz/2025/05/24/nexus3-reset-password/
作者
likp
发布于
2025年5月24日
更新于
2025年5月24日
许可协议