Sun GlassFish Enterprise Server v3 Prelude Administration Guide

Administering Passwords

There are multiple ways to administer passwords. You can rely on administrators to keep passwords secret and change the passwords regularly. You can set up files for storing passwords so that asadmin commands can access these files rather than having users type the commands.

The following topics are addressed here:

ProcedureTo Change the Administration Password

The remote change-admin-password command allows you to change the administration password. You are prompted for the old and new admin passwords, with confirmation.

  1. Ensure that the server is running.

    Remote commands require a running server.

  2. Change the admin password by using the change-admin-password(1) command.

  3. Enter the old and new admin password as prompted.


Example 6–1 Changing the Admin Password

The following example changes the admin password for user anonymous from adminadmin to newadmin:


asadmin change-admin-password --user anonymous

Information similar to the following is displayed:


Enter admin password>adminadmin
Enter new admin password>newadmin
Enter new admin password again>newadmin
Command change-admin-password executed successfully.

See Also

To see the full syntax and options of the command, type asadmin change-admin-password --help at the command line.

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:


AS_ADMIN_MASTERPASSWORD
AS_ADMIN_USERPASSWORD
AS_ADMIN_ALIASPASSWORD
  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:

    AS_ADMIN_PASSWORD=adminadmin 
  2. Save the password file.

  3. Specify the password file in an asadmin command.

    For example:


    asadmin delete-jdbc-resource --user admin --password passwords.file jdbc/DerbyPool
Troubleshooting

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.