<!--Arbortext, Inc., 1988-2008, v.4002-->
<!DOCTYPE REFENTRY PUBLIC "-//Sun Microsystems//DTD SolBook 3.5//EN" [
<!ENTITY options-common SYSTEM "options-common.sgm">
<!ENTITY synopsis-common SYSTEM "synopsis-common.sgm">
<!ENTITY % commonents SYSTEM "common.ent">
%commonents;
]>
<?Pub UDT _bookmark _target>
<?Pub EntList bull rArr sect>
<refentry id="login-1"><?Pub Tag atict:info tracking="off" ref="2"><?Pub Tag atict:user
user="hl34125" fullname=""><?Pub Tag atict:user user="pmdavies" fullname=""><?Pub Tag
atict:user user="ah95648" fullname="">
<!-- @(#)login.1 1.11 07/06/01 SMI; -->
<refmeta><refentrytitle>login</refentrytitle><manvolnum>1</manvolnum>
<refmiscinfo class="date">22 Dec 2004</refmiscinfo>
<refmiscinfo class="sectdesc">&man1;</refmiscinfo>
<refmiscinfo class="software">&software;</refmiscinfo>
<refmiscinfo class="arch">generic</refmiscinfo>
<refmiscinfo class="copyright">Copyright (c) 2004, Sun Microsystems, Inc.
All Rights Reserved</refmiscinfo>
</refmeta>
<refnamediv><indexterm><primary>login</primary></indexterm><indexterm><primary>lets
you log in to a domain</primary></indexterm>
<refname>login</refname><refpurpose>lets you log in to a domain</refpurpose>
</refnamediv>
<refsynopsisdiv><title></title>
<synopsis><command>login</command>  [<option role="double-dash">terse</option>=<replaceable>
false</replaceable>] [<option role="double-dash">echo</option>=<replaceable>false
</replaceable>]
 [<option role="double-dash">host</option> <replaceable>host_name</replaceable>] [<option
role="double-dash">port</option> <replaceable>port_number</replaceable>]
 [<option role="double-dash">secure</option>|<option>s</option>] [<option
role="double-dash">help</option>]</synopsis>
</refsynopsisdiv>
<refsect1 role="description"><title></title>
<para>Lets you log in to a domain. </para>
<para>If various<?Pub Caret> 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="double-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="double-dash">user</option> and <option
role="double-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="double-dash">host</option> and <option
role="double-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 this:</para>
<para>asadmin><userinput>create-jdbc-connection-pool --user admin --passwordfile
passwordfile.txt &lt;other options> samplePool1</userinput></para>
<para>asadmin><userinput>deploy --user admin --passwordfile passwordfile.txt &lt;other
options> /home/myapplication.ear </userinput></para>
<para>asadmin><userinput>list-components --user admin --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="double-dash">host</option> and <option role="double-dash">port</option>. 
</para>
</refsect1>
<refsect1 role="options"><title></title>
<variablelist termlength="medium">
<varlistentry><term><option>t</option> <option role="double-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>e</option> <option role="double-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>H</option> <option role="double-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>p</option> <option role="double-dash">port</option></term>
<listitem><para>The port number of the domain administration server listening
for administration requests. </para>
</listitem>
</varlistentry>
<varlistentry><term><option>s</option> <option role="double-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="double-dash">help</option></term>
<listitem><para>Displays the help text for the command.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="examples"><title></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 role="exit-status"><title></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 role="see-also"><title></title>
<para><olink targetdoc="asrefman" targetptr="create-domain-1">create-domain(1)</olink>, <olink
targetdoc="asrefman" targetptr="delete-domain-1">delete-domain(1)</olink></para>
</refsect1>
</refentry>
