I have a glassfish server runing. it has 3 different domains - d1,d2, and d3. now when I try to run asadmin enable-secure-admin
command, how to i specify which domain i want to enable?
Use the change-admin-password command or the admin console to create non-empty passwords for admin accounts. Command enable-secure-admin failed. > You must restart all running servers for the change in secure admin to take effect. >
Create a domain by using the create-domain(1) subcommand. Information about the options for this subcommand is included in this help page. Type an admin user name and password for the domain. To avoid setting up an admin login, you can accept the default admin, with no password.
The following example shows how to disable secure admin for a domain. asadmin> disable-secure-admin server-config default-config Command disable-secure-admin executed successfully.
In the domain1/config folder of GlassFish there's a file "admin-keyfile", make a backup copy of it. Change the admin line to read "admin; ;asadmin". Restart the server and you should be able to log in with just the user account "admin" and no password. Save this answer.
You must specify the port the DAS (Domain Administration Server) is running on. For example:
asadmin --host localhost --port 4848 enable-secure-admin
asadmin --host localhost --port 5858 enable-secure-admin
asadmin --host localhost --port 6868 enable-secure-admin
Of course, this assumes the ports are for d1, d2, and d3 respectively.
Hope this helps.
Before being able to enable Security, You might be prompted with a message saying your admin password is empty and cannot enable security.
To solve the problem:
Change the password of admin this way:
asadmin --host localhost --port 4848 change-admin-password
It will prompt you with user, type "admin", admin password, retype admin password
Once this is done, enable the security with the following command:
asadmin --host localhost --port 4848 enable-secure-admin
This should fix the problem.
asadmin --host www.yourdomain.com --port 4848 enable-secure-admin
Then stop/start glassfish immediately after enabling secure admin.
In case your private Glassfish runs on shared server you will need to use your custom port (assume 15123 for the example) in asadmin command. Check Java Control Panel for your Glassfish console port. Use the port with your asadmin commands. The below was tested with Glassfish 3.1.2 and 4.0.
[~]# asadmin --port 4848 enable-secure-admin
remote failure: At least one admin user has an empty password, which secure admin does not permit. Use the change-admin-password command or the admin console to create non-empty passwords for admin accounts. Command enable-secure-admin failed.
Set the password as prompted
[~]# asadmin --port 4848 change-admin-password Enter admin user name
[default: admin]> Enter admin password> Enter new admin password>
secret Enter new admin password again> secret Command
change-admin-password executed successfully.
Now retry enable-secure-admin
asadmin --port 4848 enable-secure-admin
Enter admin user name> admin
Enter admin password for user "admin"> secret
You must restart all
running servers for the change in secure admin to take effect. Command
enable-secure-admin executed successfully.
More information Glassfish: Secure Admin Must Be Enabled To Access The DAS Remotely
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With