Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Glassfish: How to do asadmin commands without password?

every time I enter a CLI-command for glassfish like this asadmin start-instance i1 I am prompted to enter the admin-username and admin-password.

How can I disable the need for entering these credentials?

I plan to write scripts for running commands like this and I think it's not possible to enter the credentials in a bash script.

Thanks

like image 498
sotix Avatar asked Aug 13 '13 13:08

sotix


1 Answers

The password file option is perhaps to verbose.

Simply do the following:

  1. asadmin start-domain mydomain

  2. asadmin login

Put in the admin user name and the admin password.

In your user home directory a file will get created

".asadminpass] successfully. Make sure that this file remains protected. Information stored in this file will be used by asadmin commands to manage the associated domain. Command login executed successfully."

like image 197
99Sono Avatar answered Nov 15 '22 04:11

99Sono