2007-10-07 17:16:16 +05:30
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
|
|
|
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
|
|
|
|
<refentry id='login.1'>
|
2007-10-07 17:17:11 +05:30
|
|
|
<!-- $Id: login.1.xml,v 1.23 2005/12/15 14:50:15 kloczek Exp $ -->
|
2007-10-07 17:16:16 +05:30
|
|
|
<refmeta>
|
2007-10-07 17:17:11 +05:30
|
|
|
<refentrytitle>login</refentrytitle>
|
2007-10-07 17:16:16 +05:30
|
|
|
<manvolnum>1</manvolnum>
|
|
|
|
<refmiscinfo class="sectdesc">User Commands</refmiscinfo>
|
|
|
|
</refmeta>
|
|
|
|
<refnamediv id='name'>
|
|
|
|
<refname>login</refname>
|
|
|
|
<refpurpose>begin session on the system</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
<!-- body begins here -->
|
|
|
|
<refsynopsisdiv id='synopsis'>
|
|
|
|
<cmdsynopsis>
|
|
|
|
<command>login</command>
|
|
|
|
<arg choice='opt'>-p </arg>
|
|
|
|
<arg choice='opt'>
|
|
|
|
<replaceable>username</replaceable></arg>
|
|
|
|
<arg choice='opt' rep='repeat'> <replaceable>ENV=VAR</replaceable></arg>
|
|
|
|
</cmdsynopsis>
|
|
|
|
<cmdsynopsis>
|
|
|
|
<command>login</command>
|
|
|
|
<arg choice='opt'>-p </arg>
|
|
|
|
<arg choice='opt'>-h <replaceable>host</replaceable></arg>
|
|
|
|
<arg choice='opt'>-f <replaceable>username</replaceable></arg>
|
|
|
|
</cmdsynopsis>
|
|
|
|
<cmdsynopsis>
|
|
|
|
<command>login</command>
|
|
|
|
<arg choice='opt'>-p </arg>
|
|
|
|
<arg choice='plain'>-r <replaceable>host</replaceable></arg>
|
|
|
|
</cmdsynopsis>
|
|
|
|
</refsynopsisdiv>
|
2007-10-07 17:17:01 +05:30
|
|
|
|
2007-10-07 17:16:16 +05:30
|
|
|
<refsect1 id='description'>
|
|
|
|
<title>DESCRIPTION</title>
|
2007-10-07 17:17:01 +05:30
|
|
|
<para>
|
|
|
|
<command>login</command> is used to establish a new session with the
|
2007-10-07 17:16:16 +05:30
|
|
|
system. It is normally invoked automatically by responding to the
|
|
|
|
<emphasis remap='I'>login:</emphasis> prompt on the user´s
|
|
|
|
terminal. <command>login</command> may be special to the shell and may
|
|
|
|
not be invoked as a sub-process. Typically, <command>login</command>
|
|
|
|
is treated by the shell as <emphasis remap='B'>exec login</emphasis>
|
2007-10-07 17:16:25 +05:30
|
|
|
which causes the user to exit from the current shell. Attempting to
|
2007-10-07 17:16:16 +05:30
|
|
|
execute <command>login</command> from any shell but the login shell
|
|
|
|
will produce an error message.
|
|
|
|
</para>
|
2007-10-07 17:17:01 +05:30
|
|
|
|
|
|
|
<para>
|
|
|
|
The user is then prompted for a password, where appropriate. Echoing
|
|
|
|
is disabled to prevent revealing the password. Only a small number of
|
|
|
|
password failures are permitted before <command>login</command> exits
|
|
|
|
and the communications link is severed.
|
2007-10-07 17:16:16 +05:30
|
|
|
</para>
|
2007-10-07 17:17:01 +05:30
|
|
|
|
|
|
|
<para>
|
|
|
|
If password aging has been enabled for your account, you may be
|
2007-10-07 17:16:16 +05:30
|
|
|
prompted for a new password before proceeding. You will be forced to
|
|
|
|
provide your old password and the new password before continuing.
|
|
|
|
Please refer to <citerefentry>
|
|
|
|
<refentrytitle>passwd</refentrytitle><manvolnum>1</manvolnum>
|
|
|
|
</citerefentry> for more information.
|
|
|
|
</para>
|
2007-10-07 17:17:01 +05:30
|
|
|
|
|
|
|
<para>
|
|
|
|
After a successful login, you will be informed of any system messages
|
|
|
|
and the presence of mail. You may turn off the printing of the system
|
|
|
|
message file, <filename>/etc/motd</filename>, by creating a
|
2007-10-07 17:17:11 +05:30
|
|
|
zero-length file <filename>.hushlogin</filename> in your login directory.
|
2007-10-07 17:17:01 +05:30
|
|
|
The mail message will be one of "<emphasis>You have new
|
|
|
|
mail.</emphasis>", "<emphasis>You have mail.</emphasis>", or
|
|
|
|
"<emphasis>No Mail.</emphasis> "according to the condition of your
|
|
|
|
mailbox.
|
2007-10-07 17:16:16 +05:30
|
|
|
</para>
|
2007-10-07 17:17:01 +05:30
|
|
|
|
|
|
|
<para>
|
|
|
|
Your user and group ID will be set according to their values in the
|
|
|
|
<filename>/etc/passwd</filename> file. The value for
|
2007-10-07 17:17:11 +05:30
|
|
|
<envar>$HOME</envar>, <envar>$SHELL</envar>, <envar>$PATH</envar>,
|
|
|
|
<envar>$LOGNAME</envar>, and <envar>$MAIL</envar> are set according
|
|
|
|
to the appropriate fields in the password entry. Ulimit, umask and nice
|
|
|
|
values may also be set according to entries in the GECOS field.
|
2007-10-07 17:16:16 +05:30
|
|
|
</para>
|
2007-10-07 17:17:01 +05:30
|
|
|
|
|
|
|
<para>
|
|
|
|
On some installations, the environmental variable
|
2007-10-07 17:17:11 +05:30
|
|
|
<envar>$TERM</envar> will be initialized to the terminal type on
|
2007-10-07 17:16:16 +05:30
|
|
|
your tty line, as specified in <filename>/etc/ttytype</filename>.
|
|
|
|
</para>
|
2007-10-07 17:17:01 +05:30
|
|
|
|
|
|
|
<para>
|
|
|
|
An initialization script for your command interpreter may also be
|
2007-10-07 17:16:16 +05:30
|
|
|
executed. Please see the appropriate manual section for more
|
2007-10-07 17:17:01 +05:30
|
|
|
information on this function.
|
2007-10-07 17:16:16 +05:30
|
|
|
</para>
|
2007-10-07 17:17:01 +05:30
|
|
|
|
|
|
|
<para>
|
|
|
|
A subsystem login is indicated by the presence of a "*" as the first
|
|
|
|
character of the login shell. The given home directory will be used as
|
|
|
|
the root of a new file system which the user is actually logged into.
|
2007-10-07 17:16:16 +05:30
|
|
|
</para>
|
2007-10-07 17:16:34 +05:30
|
|
|
|
2007-10-07 17:17:01 +05:30
|
|
|
<para>
|
|
|
|
The <command>login</command> program is NOT responsible for removing
|
|
|
|
users from the utmp file. It is the responsibility of
|
|
|
|
<citerefentry><refentrytitle>getty</refentrytitle>
|
|
|
|
<manvolnum>8</manvolnum></citerefentry> and
|
|
|
|
<citerefentry><refentrytitle>init</refentrytitle>
|
|
|
|
<manvolnum>8</manvolnum></citerefentry> to clean up apparent ownership
|
|
|
|
of a terminal session. If you use <command>login</command> from the
|
|
|
|
shell prompt without <command>exec</command>, the user you use will
|
|
|
|
continue to appear to be logged in even after you log out of the
|
|
|
|
"subsession".
|
2007-10-07 17:16:34 +05:30
|
|
|
</para>
|
|
|
|
|
2007-10-07 17:16:16 +05:30
|
|
|
</refsect1>
|
2007-10-07 17:17:01 +05:30
|
|
|
|
2007-10-07 17:16:16 +05:30
|
|
|
<refsect1 id='options'>
|
|
|
|
<title>OPTIONS</title>
|
|
|
|
<variablelist remap='IP'>
|
|
|
|
<varlistentry>
|
2007-10-07 17:17:01 +05:30
|
|
|
<term>
|
|
|
|
<option>-f</option>
|
|
|
|
</term>
|
|
|
|
<listitem>
|
|
|
|
<para>Do not perform authentication, user is preauthenticated.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
2007-10-07 17:16:16 +05:30
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
2007-10-07 17:17:01 +05:30
|
|
|
<term>
|
|
|
|
<option>-h</option>
|
|
|
|
</term>
|
|
|
|
<listitem>
|
|
|
|
<para>Name of the remote host for this login.</para>
|
|
|
|
</listitem>
|
2007-10-07 17:16:16 +05:30
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
2007-10-07 17:17:01 +05:30
|
|
|
<term>
|
|
|
|
<option>-p</option>
|
|
|
|
</term>
|
|
|
|
<listitem>
|
|
|
|
<para>Preserve environment.</para>
|
|
|
|
</listitem>
|
2007-10-07 17:16:16 +05:30
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
2007-10-07 17:17:01 +05:30
|
|
|
<term>
|
|
|
|
<option>-r</option>
|
|
|
|
</term>
|
|
|
|
<listitem>
|
|
|
|
<para>Perform autologin protocol for rlogin.</para>
|
|
|
|
</listitem>
|
2007-10-07 17:16:16 +05:30
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
2007-10-07 17:17:01 +05:30
|
|
|
|
2007-10-07 17:17:11 +05:30
|
|
|
<para>
|
|
|
|
The <option>-r</option>, <option>-h</option> and <option>-f</option>
|
|
|
|
options are only used when <command>login</command> is invoked by
|
|
|
|
root.
|
2007-10-07 17:16:16 +05:30
|
|
|
</para>
|
|
|
|
</refsect1>
|
2007-10-07 17:17:01 +05:30
|
|
|
|
2007-10-07 17:16:16 +05:30
|
|
|
<refsect1 id='caveats'>
|
|
|
|
<title>CAVEATS</title>
|
|
|
|
<para>
|
|
|
|
This version of <command>login</command> has many compilation options,
|
|
|
|
only some of which may be in use at any particular site.
|
|
|
|
</para>
|
2007-10-07 17:17:01 +05:30
|
|
|
|
2007-10-07 17:16:16 +05:30
|
|
|
<para>The location of files is subject to differences in system
|
|
|
|
configuration.
|
|
|
|
</para>
|
2007-10-07 17:17:11 +05:30
|
|
|
|
|
|
|
<para>
|
|
|
|
The <command>login</command> program is NOT responsible for removing
|
|
|
|
users from the utmp file. It is the responsibility of <citerefentry>
|
|
|
|
<refentrytitle>getty</refentrytitle><manvolnum>8</manvolnum>
|
|
|
|
</citerefentry> and <citerefentry>
|
|
|
|
<refentrytitle>init</refentrytitle><manvolnum>8</manvolnum>
|
|
|
|
</citerefentry> to clean up apparent ownership of a terminal session.
|
|
|
|
If you use <command>login</command> from the shell prompt without
|
|
|
|
<command>exec</command>, the user you use will continue to appear to
|
|
|
|
be logged in even after you log out of the "subsession".
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
As any program, <command>login</command> appearance could be faked.
|
|
|
|
If non-trusted users have a physical access to the machine, an
|
|
|
|
attacker could use this to obtain the password of the next person
|
|
|
|
sitting in front of the machine. Under Linux, the SAK mecanism can be
|
|
|
|
used by users to initiate of a trusted path and prevent this kind of
|
|
|
|
attack.
|
|
|
|
</para>
|
|
|
|
|
2007-10-07 17:16:16 +05:30
|
|
|
</refsect1>
|
2007-10-07 17:17:01 +05:30
|
|
|
|
2007-10-07 17:16:16 +05:30
|
|
|
<refsect1 id='files'>
|
|
|
|
<title>FILES</title>
|
2007-10-07 17:16:25 +05:30
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
2007-10-07 17:17:01 +05:30
|
|
|
<term><filename>/var/run/utmp</filename></term>
|
|
|
|
<listitem>
|
|
|
|
<para>list of current login sessions</para>
|
|
|
|
</listitem>
|
2007-10-07 17:16:25 +05:30
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
2007-10-07 17:17:01 +05:30
|
|
|
<term><filename>/var/log/wtmp</filename></term>
|
|
|
|
<listitem>
|
|
|
|
<para>list of previous login sessions</para>
|
|
|
|
</listitem>
|
2007-10-07 17:16:25 +05:30
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
2007-10-07 17:17:01 +05:30
|
|
|
<term><filename>/etc/passwd</filename></term>
|
|
|
|
<listitem>
|
|
|
|
<para>user account information</para>
|
|
|
|
</listitem>
|
2007-10-07 17:16:25 +05:30
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
2007-10-07 17:17:01 +05:30
|
|
|
<term><filename>/etc/shadow</filename></term>
|
|
|
|
<listitem>
|
|
|
|
<para>secure user account information</para>
|
|
|
|
</listitem>
|
2007-10-07 17:16:25 +05:30
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
2007-10-07 17:17:01 +05:30
|
|
|
<term><filename>/etc/motd</filename></term>
|
|
|
|
<listitem>
|
|
|
|
<para>system message of the day file</para>
|
|
|
|
</listitem>
|
2007-10-07 17:16:25 +05:30
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
2007-10-07 17:17:01 +05:30
|
|
|
<term><filename>/etc/nologin</filename></term>
|
|
|
|
<listitem>
|
|
|
|
<para>prevent non-root users from logging in</para>
|
|
|
|
</listitem>
|
2007-10-07 17:16:25 +05:30
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
2007-10-07 17:17:01 +05:30
|
|
|
<term><filename>/etc/ttytype</filename></term>
|
|
|
|
<listitem>
|
|
|
|
<para>list of terminal types</para>
|
|
|
|
</listitem>
|
2007-10-07 17:16:25 +05:30
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
2007-10-07 17:17:01 +05:30
|
|
|
<term><filename>$HOME/.hushlogin</filename></term>
|
|
|
|
<listitem>
|
|
|
|
<para>suppress printing of system messages</para>
|
|
|
|
</listitem>
|
2007-10-07 17:16:25 +05:30
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
2007-10-07 17:16:16 +05:30
|
|
|
</refsect1>
|
2007-10-07 17:16:25 +05:30
|
|
|
|
2007-10-07 17:16:16 +05:30
|
|
|
<refsect1 id='see_also'>
|
|
|
|
<title>SEE ALSO</title>
|
2007-10-07 17:17:01 +05:30
|
|
|
<para>
|
|
|
|
<citerefentry>
|
|
|
|
<refentrytitle>mail</refentrytitle><manvolnum>1</manvolnum>
|
2007-10-07 17:16:16 +05:30
|
|
|
</citerefentry>,
|
|
|
|
<citerefentry>
|
2007-10-07 17:17:01 +05:30
|
|
|
<refentrytitle>passwd</refentrytitle><manvolnum>1</manvolnum>
|
2007-10-07 17:16:16 +05:30
|
|
|
</citerefentry>,
|
|
|
|
<citerefentry>
|
2007-10-07 17:17:01 +05:30
|
|
|
<refentrytitle>sh</refentrytitle><manvolnum>1</manvolnum>
|
2007-10-07 17:16:16 +05:30
|
|
|
</citerefentry>,
|
|
|
|
<citerefentry>
|
2007-10-07 17:17:01 +05:30
|
|
|
<refentrytitle>su</refentrytitle><manvolnum>1</manvolnum>
|
2007-10-07 17:16:16 +05:30
|
|
|
</citerefentry>,
|
|
|
|
<citerefentry>
|
2007-10-07 17:17:01 +05:30
|
|
|
<refentrytitle>login.defs</refentrytitle><manvolnum>5</manvolnum>
|
2007-10-07 17:16:16 +05:30
|
|
|
</citerefentry>,
|
|
|
|
<citerefentry>
|
2007-10-07 17:17:01 +05:30
|
|
|
<refentrytitle>nologin</refentrytitle><manvolnum>5</manvolnum>
|
2007-10-07 17:16:16 +05:30
|
|
|
</citerefentry>,
|
|
|
|
<citerefentry>
|
2007-10-07 17:17:01 +05:30
|
|
|
<refentrytitle>passwd</refentrytitle><manvolnum>5</manvolnum>
|
2007-10-07 17:16:16 +05:30
|
|
|
</citerefentry>,
|
|
|
|
<citerefentry>
|
2007-10-07 17:17:01 +05:30
|
|
|
<refentrytitle>securetty</refentrytitle><manvolnum>5</manvolnum>
|
|
|
|
</citerefentry>,
|
|
|
|
<citerefentry>
|
|
|
|
<refentrytitle>getty</refentrytitle><manvolnum>8</manvolnum>
|
|
|
|
</citerefentry>.
|
2007-10-07 17:16:16 +05:30
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
</refentry>
|