Monday, August 22, 2016

JBOSS Security Password Generator

Ever struggling to generate Encrypted password using JBOSS Security Login Module ??
Here is how you can do it, go to JBOSS_INSTALLATION directory.

Run below command in Unix (some jars are required, locate that and give proper path in below command):
dmodi__Jboss$ java -cp ./DEPLOY_NAME/lib/jboss-common.jar:./DEPLOY_NAME/lib/jboss-jca.jar:./DEPLOY_NAME/lib/jbosssx.jar PASSWORD
Encoded password: 5f78dc15b9a559cbdf8592078de921bc

//That's it. You are done with. But do you see any problem here, yes people KNOW what is PASSWORD, when you set this in PRODUCTION environment, where many people were present.
To hide that, you need to write a Shell Script, assume file name is ""

echo "Enter Password to Encrypt for followed by Enter:"
stty -echo
read pass
stty echo
java -cp ./DEPLOY_NAME/lib/jboss-common.jar:./DEPLOY_NAME/lib/jboss-jca.jar:./DEPLOY_NAME/lib/jbosssx.jar $pass
echo 'Done'

//EXIT now=>   :wq

Run Now:

dmodi__Jboss$    sh
Enter Password to Encrypt for followed by Enter:   ( I entered same PASSWORD, but it will not be visible in console)
Encoded password: 5f78dc15b9a559cbdf8592078de921bc

//Now this password you need to put into Databse security Domain files. That you can see in many links. 
For reference:

No comments:

Post a Comment