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. 错误之thinkphp模型使用发生的错误

    刚接触thinkphp模型的创建,在创建model类时在这里边声明了类的对象.唉,这是不理解的错误啊.什么叫做实例化模型对象,在控制器里边使用才创建. 模型这里写各种用到的函数. 这里我也体会到了查询 ...

  2. Pointcut is not well-formed: expecting 'identifier' at character position 0

    异常如下: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDa ...

  3. zhcon安装过程记录

    参考资料: 1. http://www.linuxdiyf.com/viewarticle.php?id=81796 需要下载的文件有两个:zhcon-0.2.5.tar.gz和zhcon-0.2.5 ...

  4. 一个Java方法覆盖的小问题

    class SuperClass{ public SuperClass() { System.out.println("superclass "); show(); } publi ...

  5. 使用Hydra扫描网络中存在SSH弱登录密码的Linux系统

    1. apt-get install cmake libssl-dev 2. apt-get install hydra (需要图形界面的话用hydra-gtk) 3. hydra -s 22 -v ...

  6. HOWTO:制作 Windows 7 加速部署映像(作者:苏繁)

    加速部署映像 - 也就是我们通常说的系统模板,通常我们为了提高 Windows 的安装速度,会事先制作一套包含驱动.应用软件.补丁程序以及自定义设置的标准化系统.这样我们在使用该加速部署映像完成安装后 ...

  7. Excel中如何在两个工作表中查找重复数据

    有时我们可能会在两种工作表中查找重复记录,当数据记录很多时,就必须通过简单的方法来实现.下面小编就与大家一起分享一下查看重复记录数据的方法,希望对大家有所帮助. 方法/步骤   为了讲解的需要,小编特 ...

  8. JitterBuffer

    jitter buffer QoS的解决方案 注:此博客中的某些说法是有问题的,如65536的整数倍,则其buffer会太大=>64k*1.5k=98M,另在超时处理中也有问题 VOIP中何为动 ...

  9. Jersey MVC

    Jersey是JAX-RS(JavaAPI for RESTful Service)标准的一个实现,用于开发RESTful Web Application.可以参考JAX-RS的介绍(http://w ...

  10. centos7 安装mysql5.7及配置

    一.Mysql 各个版本区别:1.MySQL Community Server 社区版本,开源免费,但不提供官方技术支持.2.MySQL Enterprise Edition 企业版本,需付费,可以试 ...