Glassfish: How to execute asadmin commands without a password?

every time I enter the CLI command for Glassfish, like this asadmin start-instance i1 I am prompted to enter an administrator name and administrator password.

How do I disable the need to enter these credentials?

I plan to write scripts to run such commands, and I think it is not possible to enter credentials in a bash script.

thanks

+4
source share
2 answers

You can set a password from a file instead of entering a password on the command line.

The --passwordfile parameter accepts a file containing passwords:

 AS_ADMIN_PASSWORD=value AS_ADMIN_ADMINPASSWORD=value AS_ADMIN_USERPASSWORD=value AS_ADMIN_MASTERPASSWORD=value 
+5
source

The password file parameter is perhaps verbose.

Just do the following:

  • asadmin mydomain start-domain

  • asadmin login

Enter the administrator name and administrator password.

A file is created in the user's home directory

". asadminpass] successfully. Make sure that this file remains protected. The information stored in this file will be used by asadmin to manage the associated domain. The command was launched successfully.

+4
source

Source: https://habr.com/ru/post/1496800/


All Articles