kKdH
kKdH

Reputation: 512

I forgot the Glassfish3 master-password, how can i reset it?

I forgot the master-password of my Glassfish 3.1.2.2. Is there a way to reset it? I spent a lot of time "googling around" but i didn't find a suitable answer.

Upvotes: 11

Views: 24329

Answers (5)

silicontrip
silicontrip

Reputation: 1026

For Glassfish 4, after creating domain2 with default passwords, I also had to copy keystore.jks and domain-passwords files along with the master-password before change-master-password would recognise the password.

Upvotes: 0

DAB
DAB

Reputation: 1873

This was a big problem for me after inheriting a testing VM from a colleague who left the company. I didn't want to risk creating a new domain as described above and I tried using the contents of local-password file as also described above, but that didn't work for me.

What did work first time was the following on GlassFish Server Open Source Edition 3.1.2.2 (build 5). Change contents of this file:

$GLASSFISH_HOME$\glassfish\domains\domain1\config\admin-keyfile

with:

admin;{SSHA}WQVj8i9CLECCiv+w6ZxGgMrcfPqHPoXZW+2Jdw==;asadmin

I didn't add a newline or carriage return at the end of the line.

This is my modification of an online solution.

Upvotes: 0

Roman Popov
Roman Popov

Reputation: 191

Copy the admin-keyfile from origin install zip (empty password).

Upvotes: 0

Tim B
Tim B

Reputation: 41188

There is a backup password that can be used to access the administrator panel even if you've forgotten the main one.

If you navigate to glassfish\domains\domain1\config\ you will find a file called local-password.

The contents of that file can be used as a password to log in to the control panel as admin.

Upvotes: 17

John Clingan
John Clingan

Reputation: 3334

Please follow the below steps:

  1. Stop the domain
  2. Back up the master password file
  3. Create a new domain and save the master password:
    asadmin create-domain --savemasterpassword domain2
  4. Remember the password :-)
  5. Copy the newly created masterpassword file over the old one
  6. Delete the newly created domain:
    asadmin delete-domain domain2

FYI, now you should also know why you want to protect the master password file using file permissions :-)

Upvotes: 12

Related Questions