jboss-eap-6 数据库用户加密访问


1、打开jboss的standalone.xml,查看用户名和密码。

      

                    <datasourcejta="false" jndi-name="java:jboss/datasources/postgresDS"pool-name="postgresDS" enabled="true"use-ccm="false">

                        <connection-url>jdbc:postgresql://192.168.188.132:5432/postgres</connection-url>

                       <driver-class>org.postgresql.Driver</driver-class>

                       <driver>postgres</driver>

                       <security>

                            <user-name>postgres</user-name>

                           <password>welcome1</password>

                       </security>

                        <validation>

                           <validate-on-match>false</validate-on-match>

                           <background-validation>false</background-validation>

                        </validation>

                        <statement>

                           <share-prepared-statements>false</share-prepared-statements>

                        </statement>

                    </datasource>

2、产生密码文件:键入如下命令

java -cp/u01/app/jboss-eap-6.0/modules/org/picketbox/main/picketbox-4.0.14.Final-redhat-2.jar:/u01/app/jboss-eap-6.0/modules/org/jboss/logging/main/jboss-logging-3.1.2.GA-redhat-1.jar:$CLASSPATHorg.picketbox.datasource.security.SecureIdentityLoginModule welcome1

3、在standalone.xml的子系统secruity下加入标示2中的内容。

                    <security-domainname="PostgresDSRealm">

                        <authentication>

                            <login-modulecode="SecureIdentity" flag="required">

                               <module-option name="username" value="postgres"/>

                               <module-option name="password" value="3a71283f17004158df8592078de921bc"/>

                               <module-option name="managedConnectionFactoryName" value="jboss.jca:service=LocalTxCM,name=“postgresDS”

                           </login-module>

                        </authentication>

                    </security-domain>

                </security-domains>

           </subsystem>


4、在standalone.xml的子系统,修改security

修改步骤一的相应的节点

<security>

                        <security-domain>PostgresDSRealm</security-domain>

                       </security>

5、重启应用系统。

注意其中pool-name="postgresDS"和name=“postgresDS”相同,PostgresDSRealm两个设置的地方要一致。

如有问题可以联系q:843986029


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值