I'm trying to install GlassFish v2 on my Macintosh. The installation instructions say that it should prompt for an admin password, but it doesn't, and now I can't log into the admin console on localhost:4848. And I can't change it with asadmin change-admin-password because it needs the old one. I think I installed GlassFish with NetBeans a few months ago and might have started it up once or twice, but I don't remember what password I used back then. Is there a command I can give or a file I can delete to make it forget that old password and prompt me for a new one?
You can also create a new domain, set the admin password there to whatever you like and move the password files over to your original domain. Here's a blog post explaining the process:
Login to asadmin and start Glassfish from the command line:
/usr/local/glassfish-4.1/bin/asadmin asadmin> start-domain
The admin port should be 4848, other port causes fail in attempt to change the password. Reset password as an empty string:
asadmin> set --user admin server.jms-service.jms-host.default_JMS_host.admin-password=
It is useful for testing and development. NetBeans doesn't allow integrating Glassfish with password, password is always not accepted. To remove password is workaround.
Use this solution:
Edit file: glassfish3/glassfish/domains/domain1/config/admin-keyfile
Change for this:
You need to run this command
asadmin enable-secure-admin to make secure enable and
Enter admin user name [default: admin]> admin Enter admin password> 123456 Enter new admin password> newpass Enter new admin password again> newpass Command change-admin-password executed successfully.