Enabling and disabling Java 2 security using scripting
You can enable or disable Java™ 2 security with scripting and the wsadmin tool.
About this task
There are two ways to enable or disable Java 2 security. You can use the commands for the AdminConfig object, or you can use the setAdminActiveSecuritySettings command for the AdminTask object.
Procedure
- Use the setAdminActiveSecuritySettings command for the
AdminTask object to enable or disable Java 2
security.
- Launch the wsadmin scripting tool using the Jython scripting language. See the Starting the wsadmin scripting client article for more information.
- Use the getActiveSecuritySettings command to display
the current security settings, including custom properties for global
security, as the following example demonstrates:
- Using Jacl:
$AdminTask getActiveSecuritySettings
- Using Jython:
AdminTask.getActiveSecuritySettings()
- Using Jacl:
- Use the setAdminActiveSecuritySettings command to enable
or disable Java 2 security. The following examples enable Java 2 security:
- Using Jacl:
$AdminTask setAdminActiveSecuritySettings {-enforceJava2Security true}
- Using Jython:
AdminTask.setAdminActiveSecuritySettings('-enforceJava2Security true')
The following examples disable Java 2 security:- Using Jacl:
$AdminTask setAdminActiveSecuritySettings {-enforceJava2Security false}
- Using Jython:
AdminTask.setAdminActiveSecuritySettings('-enforceJava2Security false')
- Using Jacl:
- Save the configuration changes. 다음 명령 예제를 사용하여 구성 변경사항을 저장하십시오.
AdminConfig.save()
- Synchronize the node. AdminNodeManagement 스크립트 라이브러리에 있는 syncActiveNode 또는 syncNode 스크립트를 사용하여 구성 변경사항을 노드에 전파하십시오.
- 다음 명령 데모에 표시된 것과 같이, syncActiveNodes 스크립트를 사용하여
변경사항을 셀 내의 각 노드에 전파하십시오.
AdminNodeManagement.syncActiveNodes()
- 다음 명령 데모에 표시된 것과 같이, syncNode 스크립트를 사용하여
변경사항을 특정 노드에 전파하십시오.
AdminNodeManagement.syncNode("myNode")
- 다음 명령 데모에 표시된 것과 같이, syncActiveNodes 스크립트를 사용하여
변경사항을 셀 내의 각 노드에 전파하십시오.
- Use the AdminConfig object to enable Java 2
security.
- wsadmin 스크립트 도구를 시작하십시오.
- Identify the security configuration object and assign
it to the security variable, as the following example demonstrates:
Using Jacl:
set security [$AdminConfig list Security]
- Using Jython:
security = AdminConfig.list('Security') print security
Example output:(cells/mycell|security.xml#Security_1)
- Modify the enforceJava2Security attribute to enable
or disable Java 2 security, as the following
examples demonstrates:
To enable Java 2 security:
Using Jacl:
$AdminConfig modify $security {{enforceJava2Security true}}
- Using Jython:
AdminConfig.modify(security, [['enforceJava2Security', 'true']])
To disable Java 2 security:
Using Jacl:
$AdminConfig modify $security {{enforceJava2Security false}}
- Using Jython:
AdminConfig.modify(security, [['enforceJava2Security', 'false']])
- Save the configuration changes. 다음 명령 예제를 사용하여 구성 변경사항을 저장하십시오.
AdminConfig.save()
- Synchronize the node. AdminNodeManagement 스크립트 라이브러리에 있는 syncActiveNode 또는 syncNode 스크립트를 사용하여 구성 변경사항을 노드에 전파하십시오.
- 다음 명령 데모에 표시된 것과 같이, syncActiveNodes 스크립트를 사용하여
변경사항을 셀 내의 각 노드에 전파하십시오.
AdminNodeManagement.syncActiveNodes()
- 다음 명령 데모에 표시된 것과 같이, syncNode 스크립트를 사용하여
변경사항을 특정 노드에 전파하십시오.
AdminNodeManagement.syncNode("myNode")
- 다음 명령 데모에 표시된 것과 같이, syncActiveNodes 스크립트를 사용하여
변경사항을 셀 내의 각 노드에 전파하십시오.
Related tasks:


http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=txml_javasecurity
파일 이름:txml_javasecurity.html