Payara-Micro How to change the default master password "changeit" ?

680 views
Skip to first unread message

Vlad S

unread,
Feb 8, 2018, 4:37:08 AM2/8/18
to Payara Forum
Hi,

I tried to change the default password using a preebootcommandfile .. but I didn't find the correct command. 
Does anyone know hot to change it ?

Mike Croft

unread,
Feb 8, 2018, 4:41:48 AM2/8/18
to Payara Forum
Is it definitely the master password that you want to change? What are your goals?

Vlad S

unread,
Feb 8, 2018, 4:56:41 AM2/8/18
to Payara Forum
I want to use payara-micro  with a provided truststore file (truststore.jks). Until now I created my trustore file based on 'changeit' password. 

Vlad S

unread,
Feb 8, 2018, 7:45:16 AM2/8/18
to Payara Forum
So I need to change the password to be able to decrypt the trustiore files.


On Thursday, February 8, 2018 at 11:41:48 AM UTC+2, Mike Croft wrote:

Vlad S

unread,
Feb 8, 2018, 9:27:54 AM2/8/18
to Payara Forum
There is a change-master-password command but I don't know how to trigger it with payara micro.

On Thursday, February 8, 2018 at 11:41:48 AM UTC+2, Mike Croft wrote:

Mike Croft

unread,
Feb 9, 2018, 3:50:06 AM2/9/18
to Payara Forum
I see - if you are using any asadmin command other than "set", then a prebootcommandfile will not work, since the file will be executed too early in the server's boot cycle. Instead, you should use a postbootcommandfile. This is explained if you run java -jar payara-micro.jar --help

--postbootcommandfile             Provides a file of asadmin commands to run after booting the server
--postdeploycommandfile           Provides a file of asadmin commands to run after all deployments have completed
--prebootcommandfile              Provides a file of asadmin commands to run before booting the server (not all asadmin subcommands will yield results before booting)

Vlad S

unread,
Feb 9, 2018, 5:20:14 AM2/9/18
to Payara Forum
You are right. I thought about that too .. The problem is :

asadmin change-master-password -help 
 
"The change-master-password subcommand is used to modify the master
       password. The change-master-password subcommand is interactive in that
       the user is prompted for the old master password, as well as the new
       master password. This subcommand will not work unless the server is
       stopped. In a distributed environment, this command must run on each
       machine in the domain."

So I don't expect to work with a postbootcommandfile either. I tried it and I receive the same warnning :"Feb 09, 2018 11:02:03 AM fish.payara.micro.boot.runtime.BootCommand
WARNING: Boot Command change-master-password failed Exception while executing command."

I also tried to specify a ROOT_DIR and there in the config folder to create a master-password file with the new password, but it didn't work.
I am running out of ideas.

Steve Millidge

unread,
Feb 19, 2018, 11:36:09 AM2/19/18
to Payara Forum
For Payara micro you can use the standard -Djava.net.ssl command line options to set the keystore, truststore locations and password.


On Thursday, 8 February 2018 09:37:08 UTC, Vlad S wrote:
Reply all
Reply to author
Forward
0 new messages