login [--terse=false] [--echo=false] [--host host_name] [--port port_number] [--secure| -s ] [ --help ]
Lets you log in to a domain.
If various Enterprise Server domains are created on various machines (locally), asadmin invocation from any of these machines can manage the domains located elsewhere (remotely). This comes in handy especially when a particular machine is chosen as an administration client and it manages multiple domains and servers. asadmin commands that are used to manage domains located elsewhere are called remote commands. The asadmin login command eases the administration of such remote domains.
This command runs only in the interactive mode. It prompts you for the admin user name and password. On successful login. the file .asadminpass will be created in user's home directory. This is the same file that is modified during the create-domain command while using the --savelogin option. The domain must be running for this command to run.
The host name is stored as-is and there will be no resolution attempted with the DNS. It is enough for a user to login to a particular domain which is fully qualified by [admin-host, admin-port] pair once. Thus, if a domain is being administered from various machines, it is sufficient to invoke asadmin login once.
After logging into a domain with the asadmin login command, you need not specify the --user and --passwordfile option when you run subsequently run remote commands on that domain.
Successive successful invocations of the same command with same parameters result in overwriting the contents of .asadminpass file for the given admin host and port. The user can decide to overwrite the file or reject such a login.
Once you have logged in to a domain, you will still need to provide the host and port for the subsequent remote commands unless you have chosen the default values for --host and --port options. The advantage of this command is apparent especially if you choose the default host (localhost) and default admin port (4848).
If you do not use the login command, and you choose not to get prompted for admin user and admin password, you would invoke asadmin commands in succession like this:
asadmin>create-jdbc-connection-pool --user admin --passwordfile passwordfile.txt <other options> samplePool1
asadmin>deploy --user admin --passwordfile passwordfile.txt <other options> /home/myapplication.ear
asadmin>list-components --user admin --passwordfile passwordfile.txt <other options>
If you now log in, you can run remote commands like this:
asadmin>create-jdbc-connection-pool <other options> samplePool1
asadmin>deploy <other options> /home/myapplication.ear
asadmin>list-components <other options>
Login information is saved permanently and this information can be used across multiple domain restarts.
There is no logout command. If you want to login to another domain, invoke asadmin login with new values for --host and --port.
Indicates that any output data must be very concise, typically avoiding human-friendly sentences and favoring well-formatted data for consumption by a script. Default is false.
Setting to true will echo the command line statement on the standard output. Default is false.
The machine name where the domain administration server is running. The default value is lcoalhost. If you login to localhost, you need not specify host or port options for subsequent remote commands.
The port number of the domain administration server listening for administration requests.
If set to true, uses SSL/TLS to communicate with the domain administration server.
Displays the help text for the command.
The following command logs into a domain located on another machine:
asadmin> login --host foo --port 8282 Please enter the admin user name>admin Please enter the admin password> Trying to authenticate for administration of server at host [foo] and port  ... Login information relevant to admin user name [admin] for host [foo] and admin port  stored at [/.asadminpass] successfully. Make sure that this file remains protected. Information stored in this file will be used by asadmin commands to manage associated domain.
The following command logs into a domain on local host on default port.
asadmin> login --host myhost Please enter the admin user name>admin Please enter the admin password> Trying to authenticate for administration of server at host [myhost] and port  ... An entry for login exists for host [myhost] and port , probably from an earlier login operation. Do you want to overwrite this entry (y/n)?y Login information relevant to admin user name [admin] for host [myhost] and admin port  stored at [/home/joe/.asadminpass] successfully. Make sure that this file remains protected. Information stored in this file will be used by asadmin commands to manage associated domain.