August 2025
M T W T F S S
 123
45678910
11121314151617
18192021222324
25262728293031

Categories

August 2025
M T W T F S S
 123
45678910
11121314151617
18192021222324
25262728293031

Improve SSL Support

introduction

Every WebLogic Server installation comes with SSL support. But for some reason many installations get this interesting error message at startup:

Ignoring the trusted CA certificate “CN=Entrust Root Certification Authority – G2,OU=(c) 2009 Entrust, Inc. – for authorized use only,OU=See www.entrust.net/legal-terms,O=Entrust, Inc.,C=US”. The loading of the trusted certificate list raised a certificate parsing exception PKIX: Unsupported OID in the AlgorithmIdentifier object: 1.2.840.113549.1.1.11.

This looks odd and many people ignore these error messages. However, if your strategy is to show real error messages only, you are quickly looking for a solution. The Internet is full of possible solutions. Some recommend to remove the certificates from the JDK trust store, some recommend to use a different trust store. But is this the best solution and what are the side effects?

Main Article

Our way to the solution starts by understanding the error message. Here it is again.

Ignoring the trusted CA certificate “CN=Entrust Root Certification Authority – G2,OU=(c) 2009 Entrust, Inc. – for authorized use only,OU=See www.entrust.net/legal-terms,O=Entrust, Inc.,C=US”. The loading of the trusted certificate list raised a certificate parsing exception PKIX: Unsupported OID in the AlgorithmIdentifier object: 1.2.840.113549.1.1.11.

The first sentence is the result while the second sentence explains the reason. Looking at the reason, we quickly find the “certificate parsing exception“. But what does “PKIX: Unsupported OID in the AlgorithmIdentifier object: 1.2.840.113549.1.1.11” tell us?

  • PKIX stands for the Public Key Infrastructure (X.509). X.509 is the standard used to export, exchange, and import SSL certificates.
  • OID stands for the Object Identifier. Object Identifiers are globally unique and organized in a hierarchy. This hierarchy is maintained by the standards bodies in every country. Every standards body is responsible for a specific branch and can define and assign entries into the hierarchy.

With this background information we can lookup the number 1.2.840.113549.1.1.11 in the OID Repository (see References for the link) and get this result “iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1) sha256WithRSAEncryption(11)“.

Combining the certificate information in the first sentence and the information from the OID lookup we have the following result:

The certificate from CN=Entrust Root Certification Authority – G2,OU=(c) 2009 Entrust, Inc. – for authorized use only,OU=See www.entrust.net/legal-terms,O=Entrust, Inc.,C=US uses SHA256WithRSAEncryption which is not supported by the JDK!

You will probably see more messages for similar or different encryption algorithms used in other certificates.

The Root Cause

These factors cause this (and similar) error messages:

  • By default the Java Cryptography Extension (JCE), that comes with the JDK, implements only limited strength jurisdication policy files.
  • The default trust store of the JDK that holds this and other certificates can be found in JAVA_HOME/jre/lib/security/cacerts.
  • WebLogic Server versions before 12c come with the Certicom SSL implementation. The Certicom implementation will not be updated because the required JDK already comes with the standard SunJSSE implementation.

The Problem

The Certicom implementation works perfectly with many SSL certificates but does not support newer and stronger algorithms. Removing certificates from the default trust store or using a new trust store works only if you do not need to install third party certificates, for example from well known Certificate Authorities.

The Solution

To remove these error messages and support newer SSL certificates we have to do these steps:

  • Upgrade the jurisdication policy files with the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy files. You can download the Unlimites Strength Jurisdication files that fit for your JDK version from the Oracle Technology Network (see References). Follow the installation instructions that come with the distribution.
  • Enable SunJSSE Support in WebLogic Server
    • Login to Weblogic console
    • Go to [Select your Server] -> SSL -> Advance
    • Set “Enable JSSE” to true.
  • Restart your domain completely (including NodeManager)
    • If you start your domains with a WLST script:

      CONFIG_JVM_ARGS=’-Dweblogic.ssl.JSSEEnabled=true -Dweblogic.security.SSL.enableJSSE=true’

    • If you start your domains with the scripts startWebLogic.sh, startManagedServer.sh, or startNodeManager.sh:

      JAVA_OPTIONS=’-Dweblogic.ssl.JSSEEnabled=true -Dweblogic.security.SSL.enableJSSE=true’

Your Java and WebLogic environment is now ready to support newer SSL certificates!

 

PKIX: Unsupported OID in the AlgorithmIdentifier
POSTED ON FRIDAY, OCTOBER 28, 2011 BY BUNTY RAY
Important Notice Regarding Recent JDK Updates and Oracle WebLogic Server SSL
<Oct 27, 2011 12:25:39 AM IST> <Notice> <Security> <BEA-090898> <Ignoring the trusted CA certificate “CN=T-TeleSec Globa
lRoot Class 2,OU=T-Systems Trust Center,O=T-Systems Enterprise Services GmbH,C=DE”. The loading of the trusted certifica
te list raised a certificate parsing exception PKIX: Unsupported OID in the AlgorithmIdentifier object: 1.2.840.113549.1
.1.11.>
Recent updates to the Sun JDK (Java Developer Kit) (versions: 1.6.0_13 and 1.5.0_18) are incompatible with the SSL (Secure Socket Layer) implementation in the following versions of Oracle WebLogic Server:
* 11gR1 (10.3.1)
* 10gR3 (10.3.0)
* 10.0 and all maintenance releases of 10.0
* 9.0, 9.1, 9.2 and all maintenance releases of 9.2 prior to 9.2 MP4
Oracle JRockit versions from R27.6.4 (1.6.0_13 and 1.5.0_18) and higher also exhibit this issue.
Workaround
1) Use an earlier version of JDK – JDK1.6.0_12 and earlier will be ok.
or
2)  Replace the trust store file of \jdk\jre\lib\security\cacerts with one from earlier JDK
Reference: Oracle Doc ID 952078.1
Resolve Oracle Weblogic SSL error: The loading of the trusted certificate list raised a certificate parsing exception PKIX: Unsupported OID in the AlgorithmIdentifier object: 1.2.840.113549.1.1.11
If you encounter SSL error in Oracle Weblogic similar to the following, see a possible tip below.
May 15, 2013 12:11:07 PM PDT Notice Security BEA-090898 Ignoring the trusted CA certificate “CN=Go Daddy Root Certificate Authority – G2,O=GoDaddy.com\, Inc.,L=Scottsdale,ST=Arizona,C=US”. The loading of the trusted certificate list raised a certificate parsing exception PKIX: Unsupported OID in the AlgorithmIdentifier object: 1.2.840.113549.1.1.11.
May 15, 2013 12:11:10 PM PDT Error oracle.soa.bpel.engine BEA-000000 Unhandled exception for ComponentDN=default/bpel-110-REST!1.0*soa_d1825dc6-95b8-4efc-9028-cbf58b7efcd4/RestProcess CompositeInstanceId=6860398 ComponentInstanceId=6820014
May 15, 2013 12:11:10 PM PDT Error oracle.soa.bpel.engine BEA-000000 This exception occurred because the fault thrown in the BPEL flow was not handled by any fault handlers and reached the top-level scope. Root cause :
javax.net.ssl.SSLKeyException: FATAL Alert:BAD_CERTIFICATE – A corrupt or unuseable certificate was received.
1. Login to Weblogic console
2. Go to [Select your Server] -> SSL -> Advance
3. Set “Enable JSSE” to true.
4. Restart your weblogic.

Symptoms


When using Weblogic Scripting Tool (WLST) nmConnect() to connect to the node manager, notice warnings are seen for unsupported certificates (after running setWLSEnv.cmd or .sh)

 

Connecting to Node Manager …
CA certificate “CN=T-TeleSec GlobalRoot Class 3,OU=T-Systems Trust Center,O=T-Systems Enterprise Services GmbH,C=DE”. The loading of the trusted certificate list raised a certificate parsing exceptionPKIX: Unsupported OID in the AlgorithmIdentifier object: 
1.2.840.113549.1.1.11.>
<Notice> <Security> <BEA-090898> <Ignoring the trusted CA certificate “CN=T-TeleSec GlobalRoot Class 2,OU=T-Systems Trust Center,O=T-Systems Enterprise Services GmbH,C=DE”. The loading of the trusted certificate list raised a certificate parsing exception PKIX: Unsupported OID in the AlgorithmIdentifier object: 1.2.840.113549.1.1.11.>
<Security> <BEA-090898> <Ignoring the trusted CA certificate “CN=GlobalSign,O=GlobalSign,OU=GlobalSign Root CA – R3”. The loading of the trusted certificate list raised a certificate parsing exception PKIX: Unsupported OID in the AlgorithmIdentifier object: 1.2.840.113549.1.1.11.>
<Notice> <Security> <BEA-090898> <Ignoring the trusted CA certificate “OU=Security Communication RootCA2,O=SECOM Trust Systems CO.\,LTD.,C=JP”. The loading of the trusted certificate list raised a certificate parsing exception PKIX: Unsupported OID in the AlgorithmIdentifier object: 1.2.840.113549.1.1.11.>
<Notice> <Security> <BEA-090898> <Ignoring the trusted CA certificate “CN=KEYNECTIS ROOT CA,OU=ROOT,O=KEYNECTIS,C=FR”. The loading of the trusted certificate list raised a certificate parsing exception PKIX: Unsupported OID in the AlgorithmIdentifier object: 1.2.840.113549.1.1.11.>
Successfully Connected to Node Manager.

 

Steps

The issue can be reproduced at will with the following steps:

1. Start node manager
2. Open a command line window (or terminal window) and run setDomainEnv.cmd (or .sh)
3. Run java weblogic.WLST
4.nmConnect(‘weblogic’,’weblogic1′,’test.comain.com’,’5556′,’testDomain’,’D:\Oracle\Middleware\user_projects\domains\testDomain’,’plain’)


Cause

This is caused because of Certicom which is WLS default SSL implementation until Oracle Weblogic Server 10.3.5, does not support sha256WithRSAEncryption based certificates. Due to this reason, some certificates with that algorithm as signature are ignored and thus, the reason why those warnings are seen.

Solution

Solution 1

You can make a copy of cacerts file before removing these trusted certificates. First you need to find out alias for each of these certificates it is complaining.

keytool -list -keystore cacerts -v


(If it prompts for password, the default password is changeit most of the times).


For each of the certificate it is complaining, find the alias name from output of above command and execute following command

keytool -delete -keystore cacerts -alias keynectisrootca


(When it prompt for the password, the default password is changeit)”

This took care of the notice warnings on invalid certs. For example.

After running the setWLSEnv.cmd (or .sh, changed the directory to %JAVA_HOME%\jre\lib\security, made a backup copy of cacerts and ran the scripts: 

1. List out certificates to match them with unsupported ones (default password is changeit):

keytool -list -keystore cacerts -v > certlist.txt

This must be done in a command window that is started with “Run as Administrator” or the file cannot be read/updated. 

Redirect this to a file, as the output is large and can overflow cmd window buffer. You can search the certlist file for the owner CN or OU and get the alias name for the cert that precedes it. For example:

Alias name: ttelesecglobalrootclass3ca
Creation date: Feb 10, 2009
Entry type: trustedCertEntry

Owner: CN=T-TeleSec GlobalRoot Class 3, OU=T-Systems Trust Center, O=T-Systems Enterprise Services GmbH, C=DE
Issuer: CN=T-TeleSec GlobalRoot Class 3, OU=T-Systems Trust Center, O=T-Systems Enterprise Services GmbH, C=DE

These five notice warnings correspond to these aliases:

ttelesecglobalrootclass3ca
ttelesecglobalrootclass2ca
globalsignr3ca
secomscrootca2
keynectisrootca

2. Then, use these commands to remove the unsupported certificates from the keystore (default password is changeit):

keytool -delete -keystore cacerts -alias ttelesecglobalrootclass3ca
keytool -delete -keystore cacerts -alias ttelesecglobalrootclass2ca
keytool -delete -keystore cacerts -alias globalsignr3ca
keytool -delete -keystore cacerts -alias secomscrootca2
keytool -delete -keystore cacerts -alias keynectisrootca

If you then connect to the node manager with nmConnect, no warnings occur.

Solution 2

You can enable the JSSE SSL provider instead of Certicom to support the SHA256 algorithm. To enable JSSE, modify the startNodeManager script and add this java option to the JAVA_OPTIONS variable:

-Dweblogic.security.SSL.enableJSSE=true

This correction would also reduce log file occurrences of the same notice warning messages. Most likely within the node manager log file. There is potential that other processes that communicate with the node manager or when more parts of the WLS/FMW environment are configured to run on SSL ports that similar reduction in certificate warning messages would be reduced by this procedure.
Additionally, add the following line to the nodemanager.properties file:

CipherSuite=SSL_RSA_EXPORT_WITH_RC4_40_MD5

 

 

vironmental Information: JDK6_24, weblogic10.3 

On weblogic10.3 applications, and integrated cas single sign-on login problems, 
Specific performance: 

1 access to the new application 
Jump to a unified login page 
Log can not jump to the new application page 
4 new application logs in the background continuously output 

  1. <Security> <BEA-090477> <Certificate chain received from testserver1.gmcc.net – 10.201.37.41 was not trusted causing SSL handshake failure.>  

Process (the process can be applied to check with the initial installation of the new access SSO): 

Check for new applications CAS configuration 
Check web.xml whether to join the CAS filter 
(2) Check whether the certificate is successfully imported JRE 

  1. ?   
  2. keytool -list -v ?alias testserver1 -storepass changeit -keystore ${JRE_HOME}/lib/security/cacerts  

Check the WebLogic SSL configuration 

Enter Home> Summary of the AdminServer the Servers> General Tab, ensure that the SSL Listen Port Enabled “check status; 

Into the the Keystores Tab, ensure that the Java Standard Trust keystore “for $ {the JRE_HOME} / lib / security / cacerts (should be the same with to add jvm parameters the-Dweblogic.security.TrustKeyStore the effect) 

In addition to the problem in Step 3, the other had no problems, after performing step 3 still. 

So open the SSL debugging information (startup script add jvm parameter-Dssl.debug = the true-Dweblogic.StdoutDebugEnabled = true “) 

Start and can see the following log: 

  1. <Error> <WebLogicServer> <BEA-000297> <Inconsistent security configuration, java.security.cert.CertificateParsingException: PKIX: Unsupported OID in the AlgorithmIdentifier object: 1.2.840.113549.1.1.11>   
  2. <Emergency> <Security> <BEA-090034> <Not listening for SSL, java.io.IOException: PKIX: Unsupported OID in the AlgorithmIdentifier object: 1.2.840.113549.1.1.11.>   

Jump after logging exception log as follows: 

  1. <Debug> <SecuritySSL> <BEA-000000> <SSLSetup: loading trusted CA certificates>   
  2. <Debug> <SecuritySSL> <BEA-000000> <Failure loading trusted CA list   
  3. java.security.cert.CertificateParsingException: PKIX: Unsupported OID in the AlgorithmIdentifier object: 1.2.840.113549.1.1.11   
  4. at com.certicom.security.cert.internal.x509.X509V3CertImpl.<init>(Unknown Source)   
  5. ??????   
  6. <Debug> <SecuritySSL> <BEA-000000> <Certificate chain is untrusted>   
  7. <Debug> <SecuritySSL> <BEA-000000> <SSLTrustValidator returns: 16>   
  8. <Debug> <SecuritySSL> <BEA-000000> <Trust status (16):  CERT_CHAIN_UNTRUSTED>   
  9. <Debug> <SecuritySSL> <BEA-000000> <NEW ALERT with Severity: FATAL, Type: 42   
  10. java.lang.Exception: New alert stack   
  11. ??????   

This shows that WebLogic does not support OID 1.2.840.113549.1.1.11 algorithm, namely SHA256withRSA, algorithm; 
Is because the the CA chain certificate of SHA256withRSA algorithm, authentication fails. 

This is a bug in JDK1.6.0_13 appear in the official bug database on the 

When they JDK1.6.0_13 several certificate 

Therefore, we need to delete all the certificates use SHA256withRSA algorithm Fortunately the JDK1.6 version keytools command to list the certificate algorithm. 

We list all certificates, save the results to a text file, and then search tool to find the certificate alias contains SHA256withRSA algorithm. 

With an alias, we can use the following command to delete one by one: 

  1. keytool -delete -keystore ${JRE_HOME}/lib/security/cacerts -alias entrustrootcag2 -storepass changeit   
  2. keytool -delete -keystore ${JRE_HOME}/lib/security/cacerts -alias thawteprimaryrootcag3 -storepass changeit   
  3. keytool -delete -keystore ${JRE_HOME}/lib/security/cacerts -alias ttelesecglobalrootclass3ca -storepass changeit   
  4. keytool -delete -keystore ${JRE_HOME}/lib/security/cacerts -alias ttelesecglobalrootclass2ca -storepass changeit   
  5. keytool -delete -keystore ${JRE_HOME}/lib/security/cacerts -alias globalsignr3ca -storepass changeit   
  6. keytool -delete -keystore ${JRE_HOME}/lib/security/cacerts -alias secomscrootca2 -storepass changeit   
  7. keytool -delete -keystore ${JRE_HOME}/lib/security/cacerts -alias verisignuniversalrootca -storepass changeit   
  8. keytool -delete -keystore ${JRE_HOME}/lib/security/cacerts -alias keynectisrootca -storepass changeit   
  9. keytool -delete -keystore ${JRE_HOME}/lib/security/cacerts -alias geotrustprimarycag3 -storepass changeit   

SSL Certificate Authority in IBM HTTP Server

Creating and working with a SSL Certificate Authority in IBM HTTP Server

With thanks to Mike Whale and his excellent blog post here: –
from which I have ripped stolen reused this content.
This article describes how to create a SSL Certificate Authority using IBM HTTP Server 8.0.0.5, and then generate and use certificates signed by this CA. Alternatively, an organisation would go to a public CA such as Verisign, or they’d have their own internal CA.
Create a CA keystore
/opt/IBM/HTTPServer/java/jre/bin/ikeycmd -keydb -create -db CA.jks -type jks
Create a CA
/opt/IBM/HTTPServer/java/jre/bin/ikeycmd -cert -create -db CA.jks -label myca -dn “cn=test,o=IBM” -ca true
Create a client keystore
/opt/IBM/HTTPServer/java/jre/bin/ikeycmd -keydb -create -db client.jks -type jks
Create a CSR
/opt/IBM/HTTPServer/java/jre/bin/ikeycmd -certreq -create -db client.jks -label clientcert -file /tmp/certreq.arm -dn “cn=clienttest,o=IBM”
Sign the CSR using the CA
/opt/IBM/HTTPServer/java/jre/bin/ikeycmd -cert -sign -db CA.jks -label myca -file /tmp/certreq.arm 
Import the signed certificate into the client keystore
/opt/IBM/HTTPServer/java/jre/bin/ikeycmd -cert -receive -db client.jks -file cert.arm 
Extract the root CA certificate from the CA keystore
/opt/IBM/HTTPServer/java/jre/bin/ikeycmd -cert -extract -db CA.jks -label myca -target test.cer -type jks
Import the root CA certificate into the client keystore
/opt/IBM/HTTPServer/java/jre/bin/ikeycmd -cert -add -db client.jks -label myca -file test.cer 
Convert the client keystore into KDB ( PKCS12 ) format in order to allow password to be stashed ( required for IHS to use keystore )
/opt/IBM/HTTPServer/java/jre/bin/ikeycmd -keydb -convert -db client.jks -pw passw0rd -target client.kdb -new_pw passw0rd -old_format jks -new_format kdb -stash
Note: The only reason that I chose to create the keystore in JKS format was to follow Mike’s instructions – I could’ve simplified things by creating the keystore in KDB format from the outset.
Start IHS
/opt/IBM/HTTPServer/bin/apachectl -k restart -f /opt/IBM/HTTPServer/confext/httpd.conf
NOTE: –
If you see: –
Error 113 (net::ERR_SSL_VERSION_OR_CIPHER_MISMATCH): Unknown error.
in Chrome or: –

Cannot communicate securely with peer: no common encryption algorithm(s).

(Error code: ssl_error_no_cypher_overlap)

in Firefox, and see: –
[Tue Apr 16 12:52:31 2013] [error] [client 192.168.8.1] [7fcd6c0028d0] [25302] SSL0223E: SSL Handshake Failed, No certificate. [192.168.8.1:60917 -> 192.168.8.162:8443] [12:52:31.320280]
[Tue Apr 16 12:52:31 2013] [error] [client 192.168.8.1] [7fcd700028d0] [25302] SSL0223E: SSL Handshake Failed, No certificate. [192.168.8.1:60919 -> 192.168.8.162:8443] [12:52:31.434908]
[Tue Apr 16 12:52:53 2013] [error] [client 192.168.8.1] [1d8fd90] [25302] SSL0223E: SSL Handshake Failed, No certificate. [192.168.8.1:60940 -> 192.168.8.162:8443] [12:52:53.449571]
[Tue Apr 16 12:52:59 2013] [error] [client 192.168.8.1] [7fcd600093c0] [25302] SSL0223E: SSL Handshake Failed, No certificate. [192.168.8.1:60944 -> 192.168.8.162:8443] [12:52:59.432844]
[Tue Apr 16 12:52:59 2013] [error] [client 192.168.8.1] [7fcd600093c0] [25302] SSL0223E: SSL Handshake Failed, No certificate. [192.168.8.1:60943 -> 192.168.8.162:8443] [12:52:59.433801]
[Tue Apr 16 12:54:31 2013] [error] [client 192.168.8.1] [7fcd740128b0] [25302] SSL0223E: SSL Handshake Failed, No certificate. [192.168.8.1:60961 -> 192.168.8.162:8443] [12:54:31.636000]
etc.
in IHS error.log, then you don’t have a default certificate set: –
Listing certificates to confirm what is default / trusted
/opt/IBM/HTTPServer/bin/gskcapicmd -cert -list -db client.kdb 
 
Certificates found
* default, – personal, ! trusted
! myca
– clientcert
Set the clientcert certificate as default
/opt/IBM/HTTPServer/bin/gskcapicmd -cert -setdefault -label clientcert -db client.kdb 
Listing certificates to confirm what is default / trusted
/opt/IBM/HTTPServer/bin/gskcapicmd -cert -list -db client.kdb 
Certificates found
* default, – personal, ! trusted
! myca
*- clientcert
Inspecting certificates
/opt/IBM/HTTPServer/bin/gskcapicmd -cert -details -db client.kdb -label clientcert
Label : myca
Key Size : 1024
Version : X509 V3
Serial : 516d3a0f
Issuer : CN=test,OU=test,O=IBM
Subject : CN=test,OU=test,O=IBM
Not Before : 16 April 2013 12:46:23 GMT+01:00
Not After : 16 April 2014 12:46:23 GMT+01:00
Public Key
    30 81 9F 30 0D 06 09 2A 86 48 86 F7 0D 01 01 01
    05 00 03 81 8D 00 30 81 89 02 81 81 00 96 23 34
    A0 D0 FF 7A C3 EE 5C 06 FB EF AF D2 1A DB 5F F8
    4A E3 6A 8F 00 BC 95 67 4E 97 D4 B1 51 3B 68 F5
    85 72 4B A8 19 72 E0 82 86 6F 08 5D F5 F0 1B 34
    D2 7F F0 64 09 F8 87 B8 49 EB CF 18 D9 35 CD DE
    F4 1F FE 9F 7C 32 D7 2B 9F B0 4F 42 72 FF 02 14
    44 97 10 96 EC E0 34 B1 41 29 DF B8 E9 26 96 4F
    0A D3 FF CB 79 61 F1 E3 E0 81 45 3A 9F 88 E6 5A
    27 F8 99 A6 9C D6 3D 74 7C A8 3F 82 BB 02 03 01
    00 01
Public Key Type : RSA (1.2.840.113549.1.1.1)
Fingerprint : SHA1 :
    F6 9A C2 43 57 D8 90 07 B1 C2 5F CC 02 9F CB D6
    15 C0 5E 6C
Fingerprint : MD5 :
    A6 81 9C 1E 61 7C 52 17 3D B1 D0 90 C5 84 1D 78
Fingerprint : SHA256 :
    21 F0 B8 4B A9 9A C9 B4 40 E3 C3 39 1E C5 95 F0
    5B D0 79 70 65 67 D1 50 C5 1C E6 9E 96 1E 5B F5
Extensions
    basicConstraints
        ca = true
        pathLen = 2147483647
        critical
Signature Algorithm : SHA1WithRSASignature (1.2.840.113549.1.1.5)
Value
    73 1B 8A 4A FD 05 40 BE 2D 7C 3B 67 66 5D D1 7A
    4F F4 4D 60 95 ED 88 81 6D 98 92 5F E4 A5 FF F0
    87 D0 B5 89 F9 A6 44 78 D1 44 94 B5 7F 57 D5 C4
    3B E1 6E 9B AC FE CD C9 0A 2C A8 C8 4C 13 83 B3
    7C 06 B9 3E 66 94 2F ED FB 9A 9B F7 8E 6F CB FD
    E9 24 2D FE 7C 6C EA CA E9 76 58 37 51 B6 7E D9
    6D 59 70 2E E0 01 37 D6 E9 3B A1 C3 D3 4D 16 C9
    B4 68 99 45 85 DE 03 9A 9C D7 F4 0C 1E FC 4D C8
Trust Status : Enabled
/opt/IBM/HTTPServer/bin/gskcapicmd -cert -details -db client.kdb -label myca
Label : clientcert
Key Size : 1024
Version : X509 V3
Serial : 516d3a27
Issuer : CN=test,OU=test,O=IBM
Subject : CN=clienttest,OU=test,O=IBM
Not Before : 16 April 2013 12:46:47 GMT+01:00
Not After : 16 April 2014 12:46:47 GMT+01:00
Public Key
    30 81 9F 30 0D 06 09 2A 86 48 86 F7 0D 01 01 01
    05 00 03 81 8D 00 30 81 89 02 81 81 00 83 C5 3E
    52 CF 2E 78 76 50 88 A7 5E D6 1E 7D 2A 96 F2 11
    0E 4D 1F 1E D2 A0 E9 30 56 8E 69 79 BF C3 D0 8F
    94 8E 0B 66 62 0A 64 46 E4 60 87 D7 E8 BF 8F 54
    F2 EB 36 D0 71 18 FC 2B 72 97 B2 49 F0 12 12 4A
    4A B3 F2 1F 99 50 38 BB 40 8F 41 D2 F8 FB 8E 9B
    FC 0F BC 80 21 57 87 EA 05 F3 D4 DF BB D1 59 D7
    4D 91 68 FF B7 BC 52 BC 12 D2 F1 C6 52 63 1D B1
    49 CC 58 88 A5 E5 86 31 9B CE F3 E6 C3 02 03 01
    00 01
Public Key Type : RSA (1.2.840.113549.1.1.1)
Fingerprint : SHA1 :
    1B 33 B7 0A 1D 33 29 F2 6E 56 81 55 92 CB 48 DC
    D3 2F 16 90
Fingerprint : MD5 :
    C4 64 E5 08 AA F0 AE 65 5A 7A 12 12 21 55 7C 19
Fingerprint : SHA256 :
    54 A4 41 37 25 65 8F 28 FE 4B 97 37 DE 3A 4D 97
    80 F4 FF C0 8D BA 92 D2 51 F8 4D 4B 69 BD BA 69
Signature Algorithm : SHA1WithRSASignature (1.2.840.113549.1.1.5)
Value
    25 14 7A 6F D9 F2 CC E3 93 5C 8E 1C 4F 3C DC 57
    C8 D3 B4 D5 51 0D C9 C7 DE 00 C8 B0 2D D8 C2 F6
    50 34 97 1E 24 C8 22 D6 01 F4 DA B9 0E 1C 67 E3
    EF 73 77 F6 21 32 0D 92 B3 9B 0B C1 3A 28 71 70
    7D 3A 7E 7F 8F C3 BE 23 B0 74 F5 E7 20 5E 3D 01
    6B 57 AC 0A 5E F6 3B 93 B6 A3 E1 6A 2E E9 29 00
    4E 81 E3 D3 20 E7 86 96 C0 91 02 5D E9 86 7D 38
    08 02 B1 76 3B D4 A4 C4 41 2E 91 C0 49 84 3B 81
Trust Status : Enabled
Additional Notes
 
For the record, here’s a similar set of instructions, but using KDB ( PKCS12 ) instead of JKS from the outset, avoiding the need for conversion: –

/opt/IBM/HTTPServer/java/jre/bin/ikeycmd -keydb -create -db CA.kdb -stash

/opt/IBM/HTTPServer/java/jre/bin/ikeycmd -cert -create -db CA.kdb  -label myca -dn “cn=test,o=IBM” -ca true

/opt/IBM/HTTPServer/java/jre/bin/ikeycmd -keydb -create -db client.kdb -stash

/opt/IBM/HTTPServer/java/jre/bin/ikeycmd -certreq -create -db client.kdb  -label clientcert -file /tmp/certreq.arm -dn “cn=clienttest,o=IBM”

/opt/IBM/HTTPServer/java/jre/bin/ikeycmd -cert -sign -db CA.kdb  -label myca -file /tmp/certreq.arm 

/opt/IBM/HTTPServer/java/jre/bin/ikeycmd -cert -receive -db client.kdb  -file cert. arm 
/opt/IBM/HTTPServer/java/jre/bin/ikeycmd -cert -extract -db CA.kdb  -label myca -target test.cer

/opt/IBM/HTTPServer/java/jre/bin/ikeycmd -cert -add -db client.kdb -label myca -file test.cer 

/opt/IBM/HTTPServer/bin/apachectl -k restart -f /opt/IBM/HTTPServer/confext/httpd.conf

/opt/IBM/HTTPServer/bin/gskcapicmd -cert -setdefault -label clientcert -db client.kdb 

shell script for ssh session

#!/bin/bash
# max_number_of_ssh_client 
max_number_of_ssh_client=3
# lsof is essential
if [[ ! -x `which lsof` ]]; then
    yum install lsof -y
    RETVAL=$?
    if [[ "$RETVAL" -ne "0" ]]; then
        echo "ERROR: can NOT use lsof command, please check your internet connection or install lsof by manual! "
        exit $RETVAL
    fi
else
    # TODO
    # for awk, grep, etc
    echo "SUCCESS: This shell script will knock out extra ssh connection "
fi
# a main worker
# loop
while : ; do
    ssh_port=`netstat -anopt | grep sshd | awk '{print $4}' awk -F ':' '{print $2}' grep -v ^$ | uniq `
    ssh_clients=`lsof -i:$ssh_port | grep \> | awk '{print $9}' awk -F ':' '{print $(NF-1)}' uniq awk -F '>' '{print $2}'`
    for ssh_client in $ssh_clients; do
        number_of_ssh_client=`lsof -i:$ssh_port | grep $ssh_client | wc -l`
        if [[ $number_of_ssh_client -gt $max_number_of_ssh_client ]]; then
            number_pts=`w -hs | grep $ssh_client | awk '{print $2}' awk -F '/' '{print $2}' awk 'BEGIN {max=0} {if ($1>max) max=$1 fi} END {print max}'`
            # TODO
            # another solution maybe exist
            # kill extra logins
            pkill -kill -t pts/$number_pts
            if [[ $? -eq 0 ]]; then
                echo "SUCCESS: extra connections  $ssh_client@pts/$number_pts has been knocked out! "
            else
                echo "WARNNING: can NOT knock out extra connections! "
            fi
        else
            # TODO
            # too many INFO displayed
            echo "INFO: number of ssh connections is NORMAL! "
            # sleep 1
            sleep 1
        fi
    done
done

More on IHS and SSL – SSL0208E: SSL Handshake Failed, Certificate validation error


if you see: –
Error 101 (net::ERR_CONNECTION_RESET): The connection was reset.
in Chrome, and: –
[Wed Apr 17 05:06:32 2013] [error] [client 192.168.8.1] [7f0eb40028d0] [5144] SSL0208E: SSL Handshake Failed, Certificate validation error. [192.168.8.1:52195 -> 192.168.8.162:8443] [05:06:32.584379]
[Wed Apr 17 05:06:32 2013] [error] [client 192.168.8.1] [7f0eb400b3d0] [5144] SSL0208E: SSL Handshake Failed, Certificate validation error. [192.168.8.1:52196 -> 192.168.8.162:8443] [05:06:32.585419]
[Wed Apr 17 05:06:32 2013] [error] [client 192.168.8.1] [7f0eb800edd0] [5144] SSL0208E: SSL Handshake Failed, Certificate validation error. [192.168.8.1:52197 -> 192.168.8.162:8443] [05:06:32.586475]
[Wed Apr 17 05:06:32 2013] [error] [client 192.168.8.1] [7f0eac0115c0] [5144] SSL0208E: SSL Handshake Failed, Certificate validation error. [192.168.8.1:52198 -> 192.168.8.162:8443] [05:06:32.587517]
[Wed Apr 17 05:06:32 2013] [error] [client 192.168.8.1] [7f0eb000e7b0] [5144] SSL0208E: SSL Handshake Failed, Certificate validation error. [192.168.8.1:52199 -> 192.168.8.162:8443] [05:06:32.588528]

in the IHS error logs, chances are that you only have one certificate in the IHS SSL keystore or, to be more accurate, the root CA certificate is missing.
This can be validated as follows: –
/opt/IBM/HTTPServer/bin/gskcapicmd -cert -list -db client.kdb 

Certificates found
* default, – personal, ! trusted
*- clientcert

In other words, this shows that we only have the client certificate ( sometimes known as the intermediate or “device” certificate ) but not the CA certificate.
This is easily fixed: –
/opt/IBM/HTTPServer/java/jre/bin/ikeycmd -cert -add -db client.kdb -label myca -file test.cer
( this assumes that you’ve been following the previous post and have extracted the root CA certificate from the CA keystore into the file test.cer )
/opt/IBM/HTTPServer/bin/gskcapicmd -cert -list -db client.kdb 

Certificates found
* default, – personal, ! trusted
! myca
*- clientcert

Once IHS is restarted, all is well 🙂

Finding the process that locked a port in AIX

Finding the process that locked a port in AIX
********************************************************************
Run the following command to check if port is in use

# netstat -an | grep <port number>

If above returns the connection, then run the following command to get the address of the port number

# netstat -Aan | grep <port number>

Once you have the address of the port number, run the following command to get the process id that is using the port.

# rmsock <address of port number> tcpcb

Example
# netstat -an | grep 30767 tcp4       0      0  *.30767                *.*                    LISTEN # netstat -Aan | grep 30767 f100060001b2f398 tcp4       0      0  *.30767            *.*                LISTEN # rmsock f100060001b2f398 tcpcb The socket 0x1b2f008 is being held by proccess 942150 (vcs_agent).


Find Command General syntax of “find” command
$ find <where> <condition> <action>
FInd The Largest Files in a Directory
*************************************************
find /web( path mentioned )  -xdev -type f -ls |awk ‘{print $7″ “$8” “$9” “$10” “$11}’|sort -rn |head -20
du -a . | sort -nr | head

*******************************************************
Working with Crontab
********************************************************
—->crontab -l    —- list all the cron jobs
—->crontab -e    —- to edit the cronjobs
—->crontab -r —– to remove the crons(before removing it create a backup)
—->crontab -l > filename.txt
—->crontab -e filename.txt
—->crontab filename.txt.

weblogic script

#!/bin/sh
if [ -z "$1" ]; then
echo "You must supply either start or stop command while calling this script! correct usage: weblogic_start_stop.sh start|stop"
exit
fi
bold=`tput bold`
normal=`tput sgr0`
case "$1" in
        'start')
        echo "Starting Management Node & Weblogic Server 10.3.6"
echo "Starting NodeManager"
nohup $WLS_HOME/server/bin/startNodeManager.sh > /dev/null 2>&1 &
sleep 10
output=`ps -ef | grep -i nodemanager.javahome | grep -v grep | awk {'print $2'} | head -1`
set $output
pid=$1
echo "Weblogic NodeManager Service was started with process id : ${bold}$pid${normal}"
echo "Starting WebLogic Domain"
nohup $MW_HOME/user_projects/domains/ClassicDomain/bin/startWebLogic.sh > /dev/null 2>&1 &
# Sleep until exiting
sleep 60
echo "All done, exiting"
exit
esac
################################Stopping the services##################################
case "$1" in
        'stop')
echo "Stopping Weblogic Server & Node Manager"
nohup $MW_HOME/user_projects/domains/ClassicDomain/bin/stopWebLogic.sh > /dev/null 2>&1 &
sleep 30
# echo "Killing Nodemanager process now"
output=`ps -ef | grep -i nodemanager.javahome | grep -v grep | awk {'print $2'} | head -1`
set $output
pid=$1
echo "Killing Weblogic NodeManager Service Process : ${bold}$pid${normal}"
kill -9 `ps -ef | grep -i nodemanager.javahome | grep -v grep | awk {'print $2'} | head -1`
echo "All done, exiting"
exit
esac

gsk7cmd

SSL Commands using GSK

======================
export PATH=/opt/IBMJava/bin:/usr/local/ibm/gsk7/bin:$PATH
export
CLASSPATH=/usr/local/ibm/gsk7/classes/cfwk.zip:/usr/local/ibm /gsk7/classes/gsk7cls.jar:$CLASSPATH

Any GSK cmd can be executed using:
==================================
java com.ibm.gsk.ikeyman.ikeycmd command

Creating a new key DB with password:
====================================
gsk7cmd -keydb -create -db <filename> -pw <password> -type <cms | jks |
jceks | pks12> -expire <days> -stash

Creating a new key DB without the password:
===========================================
gsk7cmd -keydb -create -db <filename> -type <cms | jks | jceks | pks12>

Changing the password: (stashing the passwords are done for the cms
database only)
======================
gsk7cmd -keydb -changepw -db <filename>.kdb -pw <password> -new_pw
<new_password> -expire <days> -stash

Displaying the expiry dates of the certs:(for the cms database only…value
of ‘0’ means the password is not expiring)
=========================================
gsk7cmd -keydb -expiry -db filename.kdb -pw password

Listing all the certs:
======================
gsk7cmd -cert -list <CA | personal> -db <kdb-file> -pw <password> -type
<cms | jks | jceks | pks12>

Exporting the keys from one DB to another:
==========================================
gsk7cmd -cert -export -db <filename> -pw <password> -label <label> -type
<cms | jks | jceks | pkcs12> -target <filename> -target_pw <password>
-target_type <cms | jks | jceks | pkcs12>

Importing the certs from one DB to another:
===========================================
gsk7cmd -cert -import -db|-file <filename> -pw <password> -label <label>]
[> -type <cms | JKS | JCEKS | pkcs12> -new_label <label> -target <filename>
-target_pw <password> -target_type <cms | JKS | JCEKS | pkcs12>[ ]-pfx]

Receiving the CA signed cert:
=============================
gsk7cmd -cert -receive -file <filename> -db <filename> -pw <password>
-format <ascii | binary> -label <label> -default_cert <yes | no>

Default key in the DB:
======================
gsk7cmd -cert -getdefault -db <dbname> -pw <password>

Listing the expired certs:
==========================
gsk7cmd -cert -list -expiry <days> -db <filename> -pw <paswsword> -type
<type>

Showing the entire cert:
========================
gsk7cmd -cert -details -showOID -db <filename> -pw <password> -label
<label>

Storing a CA cert:
==================
gsk7cmd -cert -details -showOID -db <filename> -pw <password> -label
<label>

Create a CMS DB and stash the password:
=======================================
gsk7cmd -keydb -create -db <path_to_db>/<db_name> -pw <password> -type cms
-expire <days> -stash

To store the password after a CMS database has been created:
============================================================
gsk7cmd -keydb -stashpw -db <db_name> -pw <password>

Command line invocation for the CMS database:
=============================================
gsk7cmd -keydb -changepw -db <filename> -pw <password> -new_pw
<new_password> -stash -expire <days>

gsk7cmd -keydb -create -db <filename> -pw <password> -type <cms> -expire
<days> -stash

gsk7cmd -keydb -stashpw -db <filename> -pw <password>

gsk7cmd -cert -getdefault -db <filename> -pw <password>

gsk7cmd -cert -modify -db <filename> -pw <password> -label <label> -trust
<enable | disable>

gsk7cmd -cert -setdefault -db <filename> -pw <password> -label <label>

LAZ commands:
=============
Removing cert using gsk7cmd (personal or CA)
gsk7cmd -cert -delete -db <kdb-file> -pw <password> -label <label>

Importing Personal using gsk7cmd
gsk7cmd -cert -import -file <name> -type pkcs12 -target <kdb file>
-target_pw <passwd>] -target_type <cms | jks | jceks | pkcs12>

Importing CA using gsk7cmd
gsk7cmd -cert -add -db <kdb-file> -pw <passwd> -type <cms | jks | jceks |
pkcs12> -label <label> -file <name>

Exporting Personal to pcks12 file using gsk7cmd
gsk7cmd -cert -export -db <kdb-file> -pw <password> -label <label> -type
<cms | pkcs12> -target <filename> -target_pw <password for the filename>
-target_type <cms | pkcs12>

Exporting CA to arm file using gsk7cmd
gsk7cmd -cert -extract -db <kdb-file> -pw <password> -label <label> -target
<filename> -format ascii

Listing using gsk7cmd
gsk7cmd -cert -list <CA | personal> -db <kdb-file> -pw <password>

Listing Details using gsk7cmd
gsk7cmd -cert -details -db <kdb-file> -pw <password> -label <label>

creating the cert:
gsk7cmd -cert -create -db <filename> -pw <password> -label <label> -dn
<distinguished_name> -size <1024 | 512 | 2048> -x509version <3 | 1 | 2>
-expire <days> -san_dnsname <DNS name value>[,<DNS name value>]
–san_emailaddr <email address value>[,<email address value>] –san_ipaddr
<IP address value>[,<IP address value>]

Decrypt IBM stash files

Decrypt IBM stash files

If you are working on Websphere set of products for a while then I am sure you have been in situations where you don’t remember the password of your ssl key database file. In such a situation this perl script will help you and I am sure you will thank me but mind you this code is not mine but this is one piece of code I keep handy all the time:
——————————————————–
#!/usr/bin/perl

#usage perl unstash.pl <Stash file name ex stash.sth>

use strict;

die "Usage: $0 <stash file>\n" if $#ARGV != 0;

my $file=$ARGV[0];
open(F,$file) || die "Can't open $file: $!";

my $stash;
read F,$stash,1024;

my @unstash=map { $_^0xf5 } unpack("C*",$stash);

foreach my $c (@unstash) {
   last if $c eq 0;
   printf "%c",$c;
}
-----------------------------------------

Stash logic is same for IBM http server, Websphere application server or websphere mq. I have tested this for both gs6cmd and gsk7cmd.

Show information for solaris 10

#!/usr/bin/env ksh
export LANG=C
export PATH=${PATH}:/sbin:/usr/sbin:/usr/bin
###################################################
## Analysis for SUN by Lee Kwang Hyun
## ( Last Update. 2009.11.13 / Only Solaris 10)
###################################################
DD=`date “+%y%m%d%H%M”`
TMPVAR=”temp”
TEMPVR=”temp”
TMPTXT=/tmp/anal4sun.${DD}
ROOTFS=”/dev/rdsk/c0t0d0″
ROOTDV=”c0t0d0″
TPMC=`cat /river/SYSINFO/tpmc.txt`
#####################( MAIN )
main(){
OPTION=”$1″
### hostname
echo “HOST\t: $(hostname) (`hostid`)”
### model (product)
prtdiag | grep “^System Configuration” | awk -F”:” ‘{print “Model\t:”$2}’
### serial number
echo “Serial\t: $(sneep)”
### cpu bit
echo “CpuType\t: $(isainfo), $(isainfo -b) Bit”
### tpmc
echo “TPMC\t: ${TPMC}”
### os version n kernel patch
echo “OS\t: “`uname -a | awk ‘{print $1,$3” (“$4″)”}’`
### os version 2
head -1 /etc/release | awk ‘{print “OSv\t: “$1,$2,$3,$4,$5}’
### os install date
TMPVAR=$(ls -lrt /var/sadm/system/logs/begin.log_[1-3]*|tail -1|awk ‘{print $9}’)
echo “OSInst\t: ${TMPVAR#*_}”
### cpu
echo “CPU\t: $(psrinfo | wc -l | awk ‘{print $1}’) Core ( $(psrinfo -p) CPU ) at \c”
psrinfo -v | grep “Hz,$” | head -1 | awk ‘{print $6″ “$7}’ | sed ‘s/,//g’
### memory
echo “Memory\t: $(prtconf | grep ‘Memory size’ | awk ‘{print substr($0,14)}’)”
### information of root filesystem
ROOTFS=$(df -k | grep /$ | awk ‘{print $1}’)
metastat -p 2>/dev/null > ${TMPTXT}
if [ $? -eq 0 ];then
TEMPVR=$(metastat -p | grep ^${ROOTFS##*/} | awk ‘{print $3}’)
TMPVAR=$(metastat -p | grep ^${TEMPVR} | awk ‘{print $4}’)
ROOTDV=${TMPVAR##*/}
else
ROOTDV=${ROOTFS##*/}
fi
format > ${TMPTXT} < /dev/null
BOA=0
while read i;do
TMPVAR=$(echo $i | awk ‘{print $2}’)
if [ ${BOA} -eq 1 ];then
echo $i | awk ‘{print “BootDisk\t: “$1″ – (root disk path)”}’
break
fi
if [ -z ${TMPVAR} ];then
continue
elif [ ${TMPVAR} == ${ROOTDV%s*} ];then
BOA=1
fi
done < ${TMPTXT}
### boot path
eeprom > ${TMPTXT}
if [ $(grep device ${TMPTXT} | egrep ‘boot|diag’ | wc -l) -lt 1 ];then
TMPVAR=$(grep bootpath ${TMPTXT} | cut -d’=’ -f2)
echo “BootPath\t: ${TMPVAR} (eeprom -\c”
echo “$(grep devalias ${TMPTXT} | grep ${TMPVAR} | awk ‘{print $3}’) )”
else
TMPVAR=$(grep “boot-device” ${TMPTXT} | cut -d’=’ -f2)
echo “BootPath\t: boot-device=${TMPVAR} (eeprom -\c”
echo “$(grep devalias ${TMPTXT} | grep ${TMPVAR} | awk ‘{print $3}’) )”
TMPVAR=$(grep “diag-device” ${TMPTXT} | cut -d’=’ -f2)
echo “BootPath\t: diag-device=${TMPVAR} (eeprom -\c”
echo “$(grep devalias ${TMPTXT} | grep ${TMPVAR} | awk ‘{print $3}’) )”
fi
### ufs logging
echo “LogFS\t: $(grep ^${ROOTFS} /etc/vfstab | awk ‘{print $3,$7}’)”
### swap
swap -l | grep -v ^swapfile | awk ‘{print “SWAP\t: “$0}’
SUM=0
for i in `swap -l|grep -v ^swapfile | awk ‘{print $4}’`;do
(( SUM=SUM+i ))
done
(( SUM=SUM*10/1024/1024/2 ))
echo ${SUM}|awk ‘{print “SWAP\t: “substr($0,0,length($0)-1)”.”substr($0,length($0),1)” GB”}’
### nic
j=1
for i in `dladm show-dev | grep “: up” | awk ‘{print $1}’`;do
TMPVAR=$(ifconfig $i | grep inet | awk ‘{print $2}’)
echo “NIC${j}\t: $(dladm show-dev $i)\t( ${TMPVAR} )”
(( j=j+1 ))
done
### zfs
echo “ZFS\t: arc_max=$(kstat -p | grep zfs | grep ‘arcstats:c_max’ | awk ‘{print $2}’) (default 3214387200)”
### mpxio
echo “Mpxio\t: $(grep ^mpxio /kernel/drv/fp.conf | cut -d’;’ -f1)”
### emulex hba
TMPVAR=$(grep ^topology /kernel/drv/emlxs.conf | cut -d”=” -f2 | cut -d”;” -f1)
echo “Emulex\t: ${TMPVAR} \c”
case ${TMPVAR} in
0) echo “(loop –> p2p)”;;
2) echo “(only p2p)”;;
4) echo “(only loop)”;;
6) echo “(p2p –> loop)”;;
*) echo “(unknown)”;;
esac
### qlogic hba
TMPVAR=$(grep ‘^connection\-options’ /kernel/drv/qlc.conf | cut -d”=” -f2 | cut -d”;” -f1)
echo “Qlogic\t: ${TMPVAR} \c”
case ${TMPVAR} in
0) echo “(only loop)”;;
1) echo “(only p2p)”;;
2) echo “(loop –> p2p)”;;
*) echo “(unknown)”;;
esac
### dump
TMPVAR=$(dumpadm | grep directory | cut -d: -f2)
echo “Dump\t: dump in${TMPVAR} \c”
if [ $(df ${TMPVAR} | awk ‘{print $1}’) == “/” ];then
echo “(root fs)”
else
echo “(good)”
fi
### core
echo “Core\t: $(coreadm | grep ‘per-process core’ | awk ‘{print substr($0,8)}’) \
(`ulimit -a | grep ^coredump | awk ‘{print $2}’`)”
### os backup
echo “OSbackup\t: \c”
if [ -s /etc/dumpdates ];then
tail -1 /etc/dumpdates | awk ‘{print substr($0,40)” (“$1″)”}’
else
echo “(no record)”
fi
### security
if [ -f /etc/security/pam_acl_conf/pam_acl.conf ];then
echo “RedCat\t: $(grep ServiceAccessControl /etc/security/pam_acl_conf/pam_acl.conf|awk ‘{print $2}’)”
fi
### parm for gp
if [ ${OPTION} == “detail” ];then
echo “Parm\t: $(echo ‘rlim_fd_max/D’ | mdb -k | tail -1)”
echo “Parm\t: $(echo ‘rlim_fd_cur/D’ | mdb -k | tail -1)”
echo “Parm\t: $(echo ‘sq_max_size/D’ | mdb -k | tail -1)”
echo “Parm\t: $(echo ‘noexec_user_stack/D’ | mdb -k | tail -1)”
echo “Parm\t: $(echo ‘shminfo_shmmax/D’ | mdb -k | tail -1)”
echo “Parm\t: $(echo ‘seminfo_semmni/D’ | mdb -k | tail -1)”
echo “Parm\t: $(echo ‘apic_panic_on_nmi/D’ | mdb -k | tail -1)”
echo “Parm\t: $(echo ‘nopanicdebug/D’ | mdb -k | tail -1)”
echo “Parm\t: $(echo ‘tcp_conn_hash_size/D’ | mdb -k | tail -1)”
fi
### tune for gp
echo “TCP\t: $(ndd -get /dev/tcp tcp_largest_anon_port)”
echo “TCP\t: $(ndd -get /dev/tcp tcp_smallest_anon_port)”
echo “TCP\t: $(ndd -get /dev/tcp tcp_conn_req_min)”
echo “TCP\t: $(ndd -get /dev/tcp tcp_conn_req_max_q)”
echo “TCP\t: $(ndd -get /dev/tcp tcp_conn_req_max_q0)”
echo “TCP\t: $(ndd -get /dev/tcp tcp_time_wait_interval)”
echo “TCP\t: $(ndd -get /dev/tcp tcp_fin_wait_2_flush_interval)”
echo “TCP\t: $(ndd -get /dev/tcp tcp_max_buf)”
echo “TCP\t: $(ndd -get /dev/tcp tcp_cwnd_max)”
echo “TCP\t: $(ndd -get /dev/tcp tcp_recv_hiwat)”
echo “TCP\t: $(ndd -get /dev/tcp tcp_xmit_hiwat)”
echo “TCP\t: $(ndd -get /dev/tcp tcp_xmit_lowat)”
}
#####################( FN_mathdot )
#############################################################
if [ $(uname -r) != “5.10” ];then
echo “You can excute this script on Solaris 10 only.”
exit
fi
if [ $# -lt 1 ];then
MAINARGU=”yuna1004″
else
MAINARGU=”$1″
fi
main ${MAINARGU}
rm ${TMPTXT}

Clear contents of a file in UNIX

Clear contents of a file in UNIX

$cat /dev/null > file

or

$true > file