The login command enables you to authenticate yourself (log in to) a specific domain, after which you need not specify the administration password through the --user option or the ---passwordfile option for subsequent operations on the domain.
The login command can only be used to specify the administration password. For other passwords that remote commands require, use the --passwordfile option, or specify the passwords at the command prompt. You are always prompted for the admin user name and password.
There is no logout command. If you want to login to another domain, invoke asadmin login with new values for --host and --port.
Determine the name of the domain that you are logging in to.
To list the existing domains:
asadmin list-domains |
Log in to the domain by using the login(1)command.
The following example command logs you in to the running domain on port 4848 of host moonbeam:
asadmin login --host moonbeam --port 4848 |
Information similar to the following is displayed:
Enter admin user name[Enter to accept default]>admin Enter admin password>adminadmin GlassFish v3 Prelude (build Jennifer-private) Login information relevant to admin user name [admin] for host [localhost] and dmin port [4848] stored at [C:\Documents and Settings\Jennifer\.asadminpass] su cessfully. Make sure that this file remains protected. Information stored in this file will be used by asadmin commands to manage associated domain. Command login executed successfully. |
The following example command logs you in to the default domain of localhost:
asadmin login |
Information similar to the following is displayed:
Enter admin user name[Enter to accept default]> GlassFish v3 Prelude (build Jennifer-private) Admin login information for host [localhost] and port [4848] is being overwrittn with credentials provided. This is because the --savelogin option was used during create-domain command. Login information relevant to admin user name [anonymous] for host [localhost] nd admin port [4848] stored at [C:\Documents and Settings\Jennifer\.asadminpass successfully. Make sure that this file remains protected. Information stored in this file will be used by asadmin commands to manage associated domain. Command login executed successfully. |
To see the full syntax and options of the command, type asadmin login --help at the command line. For additional information on passwords, see Administering Passwords.