1、jmx-console登录的用户名和密码设置

默认情况访问http://localhost:8080/jmx-console就可以浏览jboss的部署管理的一些信息,不需要输入用户名和密码,使用起来有点安全隐患。下面我们针对此问题对jboss进行配置,使得访问jmx-console也必须要知道用户名和密码才可进去访问。步骤如下:

(1)找到JBoss安装目录/server/default/deploy/jmx-console.war/WEB-INF/jboss-web.xml文件,去掉<security-domain>java:/jaas/jmx-console</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)修改与(1)中的jboss-web.xml同级目录下的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>

<http-method>GET</http-method>

<http-method>POST</http-method>

</web-resource-collection>

<auth-constraint>

<role-name>JBossAdmin</role-name>

</auth-constraint>

</security-constraint>

(3) 在第一步中的jmx-console安全域和第二步中的运行角色JBossAdmin都是在login-config.xml中配置,我们在JBoss安装目录/server/default/config下找到它。查找名字为:jmx-console的application-policy:

<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-roles.properties和jmx-console-users.properties文件中设置,分别打开这两个文件。

其中jmx-console-users.properties文件的内容如下:

# A sample users.properties file for use with the UsersRolesLoginModule

admin=admin
该文件定义的格式为:用户名=密码,在该文件中,默认定义了一个用户名为admin,密码为admin的用户,可以自行修改成所需的用户名和密码。

jmx-console-roles.properties的内容如下:

# A sample roles.properties file for use with the UsersRolesLoginModule

admin=JBossAdmin, HttpInvoker

该文件定义的格式为:用户名=角色,多个角色以“,”隔开,该文件默认为admin用户定义了JBossAdmin和HttpInvoker这两个角色。

配置完成后读者可以通过访问:http://localhost:8088/jmx-console/,输入jmx-console-roles.properties文件中定义的用户名和密码,访问jmx-console的页面。

2、web-console登录的用户名和密码设置

默认情况下,用户访问JBoss的web-console时,不需要输入用户名和密码,为了安全起见,我们通过修改配置来为其加上用户名和密码。步骤如下:

(1)找到JBoss安装目录F:\JBoss\server\default\deploy\management\console-mgr.sar\web-console.war\WEB-INF\jboss-web.xml文件,去掉<security-domain>java:/jaas/web-console</security-domain>的注释,修改后的文件内容为:

<?xml version='1.0' encoding='UTF-8' ?>

<!DOCTYPE jboss-web

PUBLIC "-//JBoss//DTD Web Application 2.3V2//EN"

"http://www.jboss.org/j2ee/dtd/jboss-web_3_2.dtd">

<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>

<!-- The war depends on the -->

<depends>jboss.admin:service=PluginManager</depends>

</jboss-web>

(2)修改与(1)中的jboss-web.xml同级目录下的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

JBOSS安全配置的更多相关文章

  1. JBoss/Wildfly 配置SQLserver服务器

    JBoss/Wildfly 配置SQLserver服务器 http://blog.csdn.net/haitaolang/article/details/60467118 wildfly standa ...

  2. jboss jndi配置部分参数详解

    使用的是jboss7.1.1, jndi的配置在$JBOSS_HOME/standalone/configuration/standalone.xml中进行配置.配置jndi时有很多参数,解释下用到的 ...

  3. JBOSS安装配置详细教程

    首先在http://jbossas.jboss.org/downloads/下载相关程序我下载的是 JBoss AS 6.1.0.Final 1.配置jboss环境 1.1用户变量path后面添加 ; ...

  4. Jboss安装配置以及相关的问题

    下载地址:(目前最新版本是jboss-as-7.1.1.Final) http://download.jboss.org/jbossas/7.1/jboss-as-7.1.1.Final/jboss- ...

  5. JBOSS 数据源配置并使用JNDI调用

    -- 本文出自sleest (感谢yangjj ^_^) 场景分析: 某天系统的数据库维护方要求进行DG备库容灾演练,要把生产用RAC库模拟宕机并转移至DG备库上,由于是failover而不是swit ...

  6. JBoss 7 配置成windows启动服务

    将Jboss7 server 配置成一个windows启动服务的两个文件,部署步骤如下: 1.    先检查是否配置java_home和jboss_home的环境变量,如没配置上先配置,如我的是JBO ...

  7. Jboss 7配置日志

    1. Jboss7配置日志理论知识介绍 Jboss 7日志能够在XML配置文件和日志管理属性文件内配置.默认日志配置在configuration文件夹的logging.properties文件内. 通 ...

  8. wildfly jboss 优化配置

    参考调优:http://www.mastertheboss.com/jboss-server/jboss-performance/jboss-as-7-performance-tuning?showa ...

  9. 在同一个机器上运行两个jboss修改配置

    http://blog.sina.com.cn/s/blog_8ebe17aa0101mnft.html 解决办法:修改 \jboss-4.0.4.GA\server\default\conf 目录下 ...

随机推荐

  1. windows渗透被人忽视的一些小命令

    cmdkey /list 可以列出域内网之间可用的凭据. wmic   useraccount get name,sid gpresult /r

  2. .NET Framework 4.5 的五大特性

    介绍 从.NET4.5发布到现在已经有一年多了.但问题是针对最近微软发布的版本信息中,大部分的.NET开发人员所讨论交流的只是其中的一两个特性.其他的特性仅仅停留在MSDN中或者沦为简介文档.例如:现 ...

  3. 细说LastLogonTimeStamp

    微软在Windows Server 2003中引入了LastLogonTimeStamp属性.管理员们可以利用这个属性查看用户或者计算机最近是否登录过域.根据这些信息,管理员可以对长时间没有登录的账户 ...

  4. Office and Windows KMS使用帮助

    Office KMS Key: http://technet.microsoft.com/zh-cn/library/dn385360.aspx                         htt ...

  5. Repair duplicate IDs on cloned Endpoint Protection 12.1 clients

    https://support.symantec.com/en_US/article.TECH163349.html

  6. 【新产品发布】EVC8003 磁耦隔离型USB转全功能RS-232

    ============================== 技术论坛:http://www.eeschool.org 博客地址:http://xiaomagee.cnblogs.com 官方网店:h ...

  7. ibatis动态sql配置启动时提示:The content of elements must consist of well-formed character data...

    ibatis动态sql配置启动时提示:The content of elements must consist of well-formed character data... 2012-07-18 ...

  8. CSS权威指南 - 浮动和定位 2

    定位 定位的想法很简单元素框相对于正常位置出现在哪里. 定位:static,相对, 绝对, fixed, 继承 static就是默认的位置 相对就是相对于默认位置的偏移.原来的static定位位置依然 ...

  9. eXosip2代码分析

    主要类型定义: 1.struct eXtl_protocol struct eXtl_protocol { int enabled; int proto_port; ]; ]; int proto_n ...

  10. swfit-block反向传值

    // ViewController.swift // Block import UIKit class ViewController: UIViewController { var myLabel = ...