JBoss 远程控制安全,远程控制认证

1. 为jms-console加上认证

    (1) 修改jboss4\server\default\deploy\jmx-console.war\WEB-INF下的web.xml和jboss-web.xml

          在web.xml中把<security-constraint>的注释去掉

 
<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>
       <http-method>GET</http-method>
       <http-method>POST</http-method>
     </web-resource-collection>
     <auth-constraint>
       <role-name>JBossAdmin</role-name>
     </auth-constraint>
   </security-constraint>
 

 

           在jboss-web.xml中把<security-domain>注释去掉

 

<jboss-web>
   <!-- Uncomment the security-domain to enable security. You will
      need to edit the htmladaptor login configuration to setup the
      login modules used to authentication users.
   -->
      <security-domain>java:/jaas/jmx-console</security-domain>
</jboss-web>

 

     (2) 修改jboss4\server\default\conf\props下的两个配置文件jmx-console-roles.properties和jmx-console-users.properties,添加或修改用户和密码

 

 

2. 为web-console加上认证

    (1)  修改jboss4\server\default\deploy\management\console-mgr.sar\web-console.war\WEB-INF下的web.xml和jboss-web.xml

               在web.xml中把<security-constraint>的注释去掉

 

<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>
       <http-method>GET</http-method>
       <http-method>POST</http-method>
     </web-resource-collection>
     <auth-constraint>
       <role-name>JBossAdmin</role-name>
     </auth-constraint>
   </security-constraint>

 

   在jboss-web.xml中把<security-domain>注释去掉

 

<jboss-web>
   <!-- Uncomment the security-domain to enable security. You will
      need to edit the htmladaptor login configuration to setup the
      login modules used to authentication users.
   -->
      <security-domain>java:/jaas/web-console</security-domain>
</jboss-web>

 

(2) 修改jboss4\server\default\deploy\management\console-mgr.sar\web-console.war\WEB-INF\classes

下的两个配置文件web-console-roles.properties和web-console-users.properties,添加或修改用户和密码

 

注:修改了用户名后,jmx-console-roles.properties和web-console-roles.properties 里面Role 对应的用户名也要修改;如果不对应进行修改是登录不了的。

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值