Sun Java System Application Server supports three local commands for which the administrator password need not be specified in clear text anymore. Instead the admin password can be defined as an alias in the passwordfile. The asadmin command invokes this passwordfile through "--passwordfile" option. This feature is also useful when a domain or a server has to be automatically restarted. The commands currently supported by this feature are start-domain, start-appserv, and start-node-agent.
Ensure that the domain is running.
Create the alias for the admin user. To do this, from the directory where the domain.xml file resides (install_dir/domains/domain_dir/config by default), run the following asadmin command:
create-password-alias --port 4848 --user admin --password adminadmin --aliaspassword adminadmin adminalias
Insert the alias in a passwordfile
$cat passwordfile
AS_ADMIN_PASSWORD=${ALIAS=adminalias}
Here's an example of the start-domain command used with the password alias.
asadmin start-domain --user admin --passwordfile passwordfile domain1