jmx-console登录

参考:http://xiaoboss.iteye.com/blog/1113464

Jmx-console登录用户名密码设置:
默认情况下不需要用户名密码,但是存在安全隐患。
Jboss用户名密码设置步骤如下:
1. %JBOSS_HOME%/server/default/deploy/jmx-console.war/WEB-INF/jboss-web.xml中去掉<security-domain>java:/jaas/jmx-console</security-domain>的注解。
2. 同级目录下的web.xml中去掉security-constraint注解。
<!-- A security constraint that restricts access to the HTML JMX console
to users with the role JBossAdmin. Edit the roles to what you want and
uncomment the WEB-INF/jboss-web.xml/security-domain element to enable
secured access to the HTML JMX console.
-->
<security-constraint>
<web-resource-collection>
<web-resource-name>HtmlAdaptor</web-resource-name>
<description>An example security config that only allows users with the
role JBossAdmin to access the HTML JMX console web application
</description>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>JBossAdmin</role-name>
</auth-constraint>
</security-constraint>
3. 在第一步中的jmx-console安全域和第二步中的运行角色JBossAdmin都是在login-config.xml中配置。
在%JBOSS_HOME%/server/default/config/login-config.xml中

<!-- A template configuration for the jmx-console web application. This
defaults to the UsersRolesLoginModule the same as other and should be
changed to a stronger authentication mechanism as required.
-->
<application-policy name="jmx-console">
<authentication>
<login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
flag="required">
<module-option name="usersProperties">props/jmx-console-users.properties</module-option>
<module-option name="rolesProperties">props/jmx-console-roles.properties</module-option>
</login-module>
</authentication>
</application-policy>
由此可看出登录的用户和角色的信息分别存放在props文件下jmx-console-users.properties和jmx-console-roles.properties文件中配置
jmx-console-users.properties中:
# A sample users.properties file for use with the UsersRolesLoginModule
admin=admin
可以通过修改来改变密码admin=passweord
jmx-console-roles.properties中:
# A sample roles.properties file for use with the UsersRolesLoginModule
admin=JBossAdmin,HttpInvoker
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值