本文主要是介绍weblogic wlst connect 加密连接,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
weblogic WLST 管理的连接方法一般使用明文密码, 如果需要隐藏, 可用如下方法I will start out with a series of short posts about WLST. I have recently written a bunch of scripts and these tips would have saved me some time had a known them beforehand.
You can connect to a running Weblogic server like this:
1
2
3
. /app/oracle/domains/wlsTestDomain/bin/setDomainEnv.sh
java weblogic.WLST
connect(username='weblogic', password='mypw', url='t3://testwls01:7001')
But if you are writing a script you don’t really want to store a clear text password. Instead you can encrypt the user name and password:
1
2
3
4
5
6
. /app/oracle/domains/wlsTestDomain/bin/setDomainEnv.sh
java weblogic.WLST
connect(username='weblogic', password='mypw', url='t3://testwls01:7001')
storeUserConfig(userConfigFile='/app/oracle/scripts/userconfig.secure',
userKeyFile='/app/oracle/scripts/userkey.secure',
nm='false')
This will save a file that contains the encrypted user name and password. The other file contains the key that is used when decrypting.
Now you can connect to the server like this:
1
2
3
4
5
. /app/oracle/domains/wlsTestDomain/bin/setDomainEnv.sh
java weblogic.WLST
connect(userConfigFile='/app/oracle/scripts/userconfig.secure',
userKeyFile='/app/oracle/scripts/userkey.secure',
url='t3://testwls01:7001')
This is of cause not a perfect solution and you must ensure that that they key file is kept secure. But it is much better than clear text passwords.
It is also possible to use this when connecting to a Node Manager:
1
2
3
4
5
nmConnect(username='nodemgr', password='mypw',
domainName='wlsTestDomain', port='5556', nmType='plain')
storeUserConfig(userConfigFile='/app/oracle/scripts/userconfigNM.secure',
userKeyFile='/app/oracle/scripts/userkeyNM.secure',
nm='true')
Now connect using the key file:
1
2
3
nmConnect(userConfigFile='/app/oracle/scripts/userconfigNM.secure',
userKeyFile='/app/oracle/scripts/userkeyNM.secure',
domainName='wlsTestDomain', port='5556', nmType='plain')
Please be aware that the code snippets in this post has been formatted for easy reading and cannot be executed directly without reformatting!
转发来自 http://theheat.dk/blog/?p=157
这篇关于weblogic wlst connect 加密连接的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!