<!DOCTYPE REFENTRY PUBLIC "-//Sun Microsystems//DTD DocBook V3.0-Based SolBook Subset V2.0//EN" [
<!--ArborText, Inc., 1988-1999, v.4002-->
<!ENTITY metainfo SYSTEM "metainfo.sgm">
<!ENTITY options-common SYSTEM "options-common.sgm">
<!ENTITY synopsis-common SYSTEM "synopsis-common.sgm">
<!ENTITY Date "22 Dec 2004">
<!ENTITY SectDesc "User Commands">
<!ENTITY Software "J2EE SDK 1.4">
<!ENTITY arch "generic">
<!ENTITY copyright "Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved">
<!ENTITY % commonents SYSTEM "smancommon.ent">
%commonents;
<!ENTITY % booktitles SYSTEM "booktitles.ent">
%booktitles;
<!ENTITY Dash "&ndash;">
]>
<?Pub UDT _bookmark _target>
<?Pub Inc>
<refentry id="login-1">
<refmeta><refentrytitle>login</refentrytitle><manvolnum>1</manvolnum>&metainfo;
</refmeta>
<refnamediv><indexterm><primary sortas="set">login&mdash; lets you log in
to a domain</primary></indexterm><indexterm><primary sortas=" sets the values of attributes">
lets you log in to a domain &mdash; login</primary></indexterm><refname>login
</refname><refpurpose>lets you log in to a domain</refpurpose></refnamediv>
<refsynopsisdiv><title>&synp-tt;</title>
<cmdsynopsis><command>login</command><arg choice="opt">&Dash;&Dash;terse=<replaceable>
false</replaceable></arg><arg>&Dash;&Dash;echo=<replaceable>false</replaceable></arg>
<arg choice="opt">&Dash;&Dash;host <replaceable>host_name</replaceable></arg>
<arg choice="opt">&Dash;&Dash;port <replaceable>port_number</replaceable></arg>
<arg>&Dash;&Dash;secure|<option role="nodash">&Dash;s</option></arg><arg>&Dash;&Dash;help
</arg>
</cmdsynopsis></refsynopsisdiv>
<refsect1><title>&desc-tt;</title>
<para>Lets you log in to a domain. </para>
<para>If various application server domains are created on various machines
(locally), <command>asadmin</command> 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. <command>asadmin</command> commands that are
used to manage domains located elsewhere are called remote commands. The <command>
asadmin login</command> command eases the administration of such remote domains. 
</para>
<para>This command runs only in the interactive mode. It prompts you for the
admin user name and password. On successful login. the file <filename>.asadminpass
</filename> will be created in user's home directory. This is the same file
that is modified during the <command>create-domain</command> command while
using the <option role="nodash">&Dash;&Dash;savelogin</option> option. The
domain must be running for this command to run.</para>
<para>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 <command>
asadmin login</command> once. </para>
<para>After logging into a domain with the <command>asadmin login</command>
command, you need not specify the <option role="nodash">&Dash;&Dash;user</option>
and <option role="nodash">&Dash;&Dash;passwordfile</option> option when you
run subsequently run remote commands on that domain.</para>
<para>Successive successful invocations of the same command with same parameters
result in overwriting the contents of <filename>.asadminpass</filename> file
for the given admin host and port. The user can decide to overwrite the file
or reject such a login.</para>
<para>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 <option role="nodash">&Dash;&Dash;host</option> and <option
role="nodash">&Dash;&Dash;port</option> options.The advantage of this command
is apparent especially if you choose the default  host (localhost) and default
admin port (4848).</para>
<para>If you do not use the login command,  and you choose not to get prompted
for admin user and admin password, you would invoke <command>asadmin</command>
commands in succession like thi<?Pub Caret>s:</para>
<para>asadmin><userinput>create-jdbc-connection-pool &Dash;&Dash;user admin &Dash;&Dash;passwordfile
passwordfile.txt &lt;other options> samplePool1</userinput></para>
<para>asadmin><userinput>deploy &Dash;&Dash;user admin &Dash;&Dash;passwordfile
passwordfile.txt &lt;other options> /home/myapplication.ear </userinput></para>
<para>asadmin><userinput>list-components &Dash;&Dash;user admin &Dash;&Dash;passwordfile
passwordfile.txt &lt;other options></userinput></para>
<para>If you now log in, you can run remote commands like this:</para>
<para>asadmin><userinput>create-jdbc-connection-pool &lt;other options> samplePool1
</userinput></para>
<para>asadmin><userinput>deploy &lt;other options> /home/myapplication.ear 
</userinput></para>
<para>asadmin><userinput>list-components &lt;other options></userinput></para>
<para>Login information is saved permanently and this information can be used
across multiple domain restarts. </para>
<para>There is no <command>logout</command> command. If you want to login
to another domain, invoke <command>asadmin login</command> with new values
for <option role="nodash">&Dash;&Dash;host</option> and <option role="nodash">&Dash;&Dash;port
</option>. </para>
</refsect1>
<refsect1><title>OPTIONS</title>
<variablelist termlength="medium">
<varlistentry><term><option role="nodash">&Dash;t</option> <option role="nodash">&Dash;&Dash;terse
</option></term><listitem><para>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.</para>
</listitem></varlistentry>
<varlistentry><term><option role="nodash">&Dash;e</option> <option role="nodash">&Dash;&Dash;echo
</option></term><listitem><para>Setting to true will echo the command line
statement on the standard output. Default is false.</para>
</listitem></varlistentry>
<varlistentry><term><option role="nodash">&Dash;H</option> <option role="nodash">&Dash;&Dash;host
</option></term><listitem><para>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. 
</para>
</listitem></varlistentry>
<varlistentry><term><option role="nodash">&Dash;p</option> <option role="nodash">&Dash;&Dash;port
</option></term><listitem><para>The port number of the domain administration
server listening for administration requests. The default port number for
Platform Edition is 4848. The default port number for Enterprise Edition is
4849.</para>
</listitem></varlistentry>
<varlistentry><term><option role="nodash">&Dash;s</option> <option role="nodash">&Dash;&Dash;secure
</option></term><listitem><para>If set to true, uses SSL/TLS to communicate
with the domain administration server.</para>
</listitem></varlistentry>
<varlistentry><term> <option role="nodash">&Dash;&Dash;help</option></term>
<listitem><para>Displays the help text for the command.</para>
</listitem></varlistentry>
</variablelist></refsect1>
<refsect1><title>&exam-tt;</title>
<example>
<title>Using the login command </title>
<para>The following command logs into a domain located on another machine:
</para>
<screen>asadmin> <userinput>login --host foo --port 8282</userinput>
Please enter the admin user name>admin
Please enter the admin password>    

Trying to authenticate for administration of server at host [foo] 
and port [8282] ...
Login information relevant to admin user name [admin] for host [foo] 
and admin port [8282] 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.

</screen>
</example>
<example>
<title>Using the login command</title>
<para>The following command logs into a domain on local host on default port.
</para>
<screen>asadmin> <userinput>login --host myhost</userinput>
Please enter the admin user name>admin
Please enter the admin password>
Trying to authenticate for administration of server at host [myhost] and port [4848] ...
An entry for login exists for host [myhost] and port [4848], 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 [4848] 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.</screen>
</example>
</refsect1>
<refsect1><title>EXIT STATUS</title>
<variablelist termlength="medium">
<varlistentry><term>0</term><listitem><para>command executed successfully
</para>
</listitem></varlistentry>
<varlistentry><term>1</term><listitem><para>error in executing the command
</para>
</listitem></varlistentry>
</variablelist></refsect1>
<refsect1><title>&also-tt;</title>
<para><link linkend="create-domain-1"><citerefentry><refentrytitle>create-domain
</refentrytitle><manvolnum>1</manvolnum></citerefentry></link>, <link linkend="delete-domain-1"><citerefentry>
<refentrytitle>delete-domain</refentrytitle><manvolnum>1</manvolnum></citerefentry></link></para>
</refsect1>
</refentry>
<?Pub *0000009503>
