blob: 54ab87b846ced423ec8c26c8a8c7ad01310a6602 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<!--Converted with LaTeX2HTML 96.1-h (September 30, 1996) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds -->
<HTML>
<HEAD>
<TITLE>What login does</TITLE>
<META NAME="description" CONTENT="What login does">
<META NAME="keywords" CONTENT="sag">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<LINK REL=STYLESHEET HREF="sag.css">
</HEAD>
<BODY LANG="EN" >
<A NAME="tex2html1345" HREF="node83.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="./next_motif.gif"></A> <A NAME="tex2html1343" HREF="node79.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="./up_motif.gif"></A> <A NAME="tex2html1337" HREF="node81.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="./previous_motif.gif"></A> <A NAME="tex2html1347" HREF="node1.html"><IMG WIDTH=65 HEIGHT=24 ALIGN=BOTTOM ALT="contents" SRC="./contents_motif.gif"></A> <A NAME="tex2html1348" HREF="node114.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="./index_motif.gif"></A> <BR>
<B> Next:</B> <A NAME="tex2html1346" HREF="node83.html">X and xdm</A>
<B>Up:</B> <A NAME="tex2html1344" HREF="node79.html">Logging In And Out</A>
<B> Previous:</B> <A NAME="tex2html1338" HREF="node81.html">Logins via the network</A>
<BR> <P>
<A NAME="2646"> </A><H1><A NAME="SECTION00930000000000000000">What <tt>login</tt> does</A></H1>
<P>
The <tt>login</tt><A NAME="2648"> </A> program takes care of authenticating the user
(making sure that the username and password match), and of
setting up an initial environment for the user by setting
permissions for the serial line and starting the shell.
<P>
Part of the initial setup is outputting the contents of the
file <tt>/etc/motd</tt><A NAME="2650"> </A> (short for message of the day) and checking
for electronic mail. These can be disabled by creating a file
called <tt>.hushlogin</tt><A NAME="2652"> </A> in the user's home directory.
<P>
If the file <tt>/etc/nologin</tt><A NAME="2654"> </A> exists, logins are
disabled. That file is typically created by <tt>shutdown</tt><A NAME="2656"> </A>
and relatives. <tt>login</tt><A NAME="2658"> </A> checks for this file, and will
refuse to accept a login if it exists. If it does exist,
<tt>login</tt><A NAME="2660"> </A> outputs its contents to the terminal before it quits.
<P>
<tt>login</tt><A NAME="2662"> </A> logs all failed login attempts in a system log file
(via <tt>syslog</tt><A NAME="2664"> </A>). It also logs <em>all</em> logins by <tt>root</tt>.
Both of these can be useful when tracking down intruders.
<P>
Currently logged in people are listed in <tt>/var/run/utmp</tt><A NAME="2666"> </A>.
This file is valid only until the system is next rebooted or shut
down; it is cleared when the system is booted. It lists each
user and the terminal (or network connection) he is using, along
with some other useful information. The <tt>who</tt><A NAME="2668"> </A>, <tt>w</tt><A NAME="2670"> </A>, and
other similar commands look in <tt>utmp</tt><A NAME="2672"> </A> to see who are logged in.
<P>
All successful logins are recorded into <tt>/var/log/wtmp</tt><A NAME="2674"> </A>.
This file will grow without limit, so it must be cleaned
regularly, for example by having a weekly <tt>cron</tt><A NAME="2676"> </A> job
to clear it.<A NAME="tex2html40" HREF="footnode.html#2559"><IMG ALIGN=BOTTOM ALT="gif" SRC="./foot_motif.gif"></A> The <tt>last</tt><A NAME="2678"> </A> command browses <tt>wtmp</tt><A NAME="2680"> </A>.
<P>
Both <tt>utmp</tt><A NAME="2682"> </A> and <tt>wtmp</tt><A NAME="2684"> </A> are in a binary format (see the
<em>utmp</em><A NAME="2686"> </A> manual page); it is unfortunately not convenient
to examine them without special programs.
<P>
<HR><A NAME="tex2html1345" HREF="node83.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="./next_motif.gif"></A> <A NAME="tex2html1343" HREF="node79.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="./up_motif.gif"></A> <A NAME="tex2html1337" HREF="node81.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="./previous_motif.gif"></A> <A NAME="tex2html1347" HREF="node1.html"><IMG WIDTH=65 HEIGHT=24 ALIGN=BOTTOM ALT="contents" SRC="./contents_motif.gif"></A> <A NAME="tex2html1348" HREF="node114.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="./index_motif.gif"></A> <BR>
<B> Next:</B> <A NAME="tex2html1346" HREF="node83.html">X and xdm</A>
<B>Up:</B> <A NAME="tex2html1344" HREF="node79.html">Logging In And Out</A>
<B> Previous:</B> <A NAME="tex2html1338" HREF="node81.html">Logins via the network</A>
<P><ADDRESS>
<I>Lars Wirzenius <BR>
Sat Nov 15 02:32:11 EET 1997</I>
</ADDRESS>
</BODY>
</HTML>
|