Sun GlassFish Enterprise Server v3 Administration Guide

ProcedureTo Set a Password From a File

Instead of typing the password at the command line, you can access the password for a command from a file such as passwords.txt. The --passwordfile option of the asadmin utility takes the name of the file that contains the passwords. The entry for a password in the file must have the AS_ADMIN_ prefix followed by the password name in uppercase letters.

The following other types of passwords can be specified:

  1. Edit the password file.

    For example, to specify the password for the domain administration server (DAS), add an entry similar to the following to the password file, where adminadmin is the administrator password:

  2. Save the password file.

    You can now specify the password file in an asadmin subcommand. In This example, passwords.txt is the file that contains the password:

    asadmin>delete-jdbc-resource --user admin --password passwords.txt jdbc/DerbyPool

If AS_ADMIN_PASSWORD has been exported to the global environment, specifying the --passwordfile option will produce a warning about using the --passwordfile option. To prevent this warning situation from happening, unset AS_ADMIN_PASSWORD.