jboss-eap-6 数据库用户加密访问
2016-05-18 18:05
190 查看
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>
<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>[b]PostgresDSRealm</security-domain>
[/b]
</security>
[b]如有问题可以联系q:843986029[/b]
<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.SecureIdentityLoginModulewelcome13、在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>[b]PostgresDSRealm</security-domain>
[/b]
</security>
5、重启应用系统。
注意其中pool-name="postgresDS"和name=“postgresDS”相同,[b]PostgresDSRealm两个设置的地方要一致。[/b][b]如有问题可以联系q:843986029[/b]
相关文章推荐
- MySql删除表
- Redis与Memcached的区别
- MySQL学习笔记(二)
- 操作 redis-jedis--spring-哨兵 2
- SQL Server多行结果转换为一行
- MYSQL的存储引擎介绍------MyISAM引擎
- MySQL远程连接:Host 'x' is not allowed to connect to this MySQL server
- MySQL远程连接:Host 'x' is not allowed to connect to this MySQL server
- MySQL远程连接:Host 'x' is not allowed to connect to this MySQL server
- redis-jedis--spring-哨兵
- 收藏表 数据库设计
- 如何修改WAMP中mysql默认空密码
- MySQL DATE_FORMAT() 函数
- solr连接数据库,实现数据定时同步(个人项目经验)
- SqlServer存储过程输出参数
- mysqldump.exe is version 5.5 but the mysql server to be dumped has version 5.6
- Sql注入一种dump所有数据的方法
- Mysql Tigger触发器创建和使用
- [转]oracle分页用两层循环还是三层循环?
- 微博关注我、我关注你数据库该怎么设计