How do i reset the forgotten password of glassfish server 4
Asked Answered
R

2

7

Recently, i change the password for admin, and unfortunately i don't remember the password of my glassfish server 4. How, can i reset the password.

I've followed the instruction provided in the following link "https://superuser.com/questions/7654/how-to-reset-delete-my-glassfish-password", but it didn't help me.

i went to this path "../glassfish4/glassfish/domains/MyDomain/config/" and change the "admin-keyfile" file, but still it didn't help me.

Roaster answered 10/12, 2016 at 18:12 Comment(0)
R
26

Finally, after few hours of posting the question, i found a solution. On my glassfish installed directory, this in my case /glassfish4/glassfish/domains/mydomain/config. I edit the file named with file name admin-keyfile. i added this line next to the existing line( but i commented the existing line).

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

Then i restart the glassfish server.

Since, i m loading the glassfish server in different machine[Not required if running locally], i additionally need to run this command asadmin enable-secure-admin to make secure enable and asadmin change-admin-password. To set new password. Then i restarted the server again.
Finally it worked.

Roaster answered 10/12, 2016 at 19:47 Comment(2)
Once the above commands are executed. asadmin change-admin-password will ask for old password after giving in username. Just press enter and giving new password for next question. new login should work..Wingspan
Some More Steps $ ./asadmin $ change-master-password --savemasterpassword // default password is chageit $ change-admin-password // default password is blank and admin user name is admin $ start-domain $ wget localhost:8080 $ enable-secure-admin $ restart-domainPlexiform
M
0

For me creating a new domain and replacing old domain's keyfile with the new one worked.

My glassfish version 2.1.1 and OS is windows server

  1. stop your glass domain (eg for domain name : domain1)
asadmin stop-domain domain1
  1. backup .asadminpass (only required if you had savemasterpassword enabled) and admin-keyfile
move /Users/your_username/.asadminpass to  .asadminpass_bkup
move {glassfishpath}/domains/domain1/config/admin-keyfile to  admin-keyfile_bkup
  1. create a new domain and fill in the username with what you had in your original domain. probably admin
 asadmin create-domain --adminport 4848 domain2
  1. copy new domain's admin-keyfile to old domain
copy {glassfishpath}/domains/domain2/config/admin-keyfile to {glassfishpath}/domains/domain1/config/admin-keyfile
  1. Start your server
asadmin start-domain domain1

Voilla now your domain1's password is changed to the password you inserted when creating domain2

Miraculous answered 22/5, 2023 at 9:15 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.