jenkins从角色管理权限策略转移,默认策略后再登录,管理员登陆提示:Access Denied admin没有Overall/Read权限
此时可以登录,但是不能够对jenkins系统进行配置.
操作:
1,
进入jenkins 家目录下,有config.xml 一般为~/.jenkins 目录下,修改此配置文件
vim config.xml
##删除以下数据后重启服务
<useSecurity>true</useSecurity>
<authorizationStrategy class="hudson.security.GlobalMatrixAuthorizationStrategy">
<permission>hudson.model.Item.Build:build</permission>
<permission>hudson.model.Item.Cancel:build</permission>
<permission>hudson.model.Item.Configure:build</permission>
<permission>hudson.model.Item.Create:build</permission>
<permission>hudson.model.Item.Delete:build</permission>
<permission>hudson.model.Item.Discover:build</permission>
<permission>hudson.model.Item.Read:build</permission>
<permission>hudson.model.Item.Workspace:build</permission>
</authorizationStrategy>
<securityRealm class="hudson.security.HudsonPrivateSecurityRealm">
<disableSignup>true</disableSignup>
<enableCaptcha>false</enableCaptcha>
</securityRealm>
2,改回原来默认的策略
http://192.168.2.141:8080/configureSecurity/访问
设置:
1,启用安全
2,安全域--->Jenkins’ own user database
3,授权策略--->Logged-in users can do anything
恢复默认状态
忘记密码
#jenkins目录下user/admin-xxx/config.xml
123456加密后: #jbcrypt:$2a$10$MiIVR0rr/UhQBqT.bBq0QehTiQVqgNpUGyWW2nJObaVAM/2xSQdSq
修改后重启服务