Sun GlassFish Enterprise Server v3 Administration Guide

ProcedureTo Create a Password Alias

Use the create-password-alias subcommand in remote mode to create an alias for a password in the domain's keystore. The password corresponding to the alias name is stored in an encrypted form in the domain configuration file. The create-password-alias subcommand takes both a secure interactive form, in which users are prompted for all information, and a more script-friendly form, in which the password is propagated on the command line.

You can also use the set(1) subcommand to remove and replace the password in the configuration file. For example:


asadmin set --user admin server.jms-service.jms-host.default_JMS_host.
admin-password='${ALIAS=jms-password}'
  1. Ensure that the server is running.

    Remote subcommands require a running server.

  2. Go to the directory where the configuration file resides.

    By default, the configuration file is located in domain-dir/config.

  3. Create the password alias by using the create-password-alias(1) subcommand.

  4. Type the password for the alias when prompted.

  5. Add the alias to a password file.

    In the password file, for example, passwords.txt, add the following line: AS_ADMIN_PASSWORD=${ALIAS=admin-password-alias}, where admin-password-alias is the new password alias.

  6. Stop the Enterprise Server domain.

    See To Stop a Domain.

  7. Start the domain specifying the file that contains the alias.

    Use the following syntax:


    start-domain --user admin --passwordfile /path-to/passwords.txt domain1

Example 11–3 Creating a Password Alias

This example creates the new jms-password alias for the admin user:


asadmin> create-password-alias --user admin jms-password

You are prompted to type the password for the alias:


Please enter the alias password>secret-password
Please enter the alias password again>secret-password
Command create-password-alias executed successfully.

See Also

You can also view the full syntax and options of the subcommand by typing asadmin help create-password-alias at the command line.