📄 node76.html
字号:
<!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" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/sag.css">
</HEAD>
<BODY LANG="EN" >
<A NAME="tex2html1250" HREF="node77.html" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/node77.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="next_motif.gif" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/next_motif.gif"></A> <A NAME="tex2html1248" HREF="node73.html" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/node73.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="up_motif.gif" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/up_motif.gif"></A> <A NAME="tex2html1242" HREF="node75.html" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/node75.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="previous_motif.gif" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/previous_motif.gif"></A> <A NAME="tex2html1252" HREF="node1.html" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/node1.html"><IMG WIDTH=65 HEIGHT=24 ALIGN=BOTTOM ALT="contents" SRC="contents_motif.gif" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/contents_motif.gif"></A> <A NAME="tex2html1253" HREF="node108.html" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/node108.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="index_motif.gif" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/index_motif.gif"></A> <BR>
<B> Next:</B> <A NAME="tex2html1251" HREF="node77.html" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/node77.html">X and xdm</A>
<B>Up:</B> <A NAME="tex2html1249" HREF="node73.html" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/node73.html">Logging In And Out</A>
<B> Previous:</B> <A NAME="tex2html1243" HREF="node75.html" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/node75.html">Logins via the network</A>
<BR> <P>
<A NAME="2306"> </A><H1><A NAME="SECTION00830000000000000000"><tt>login</tt>干了些什么</A></H1>
<P>
<tt>login</tt><A NAME="2308"> </A>程序负责认证用户(确认用户名和口令相配),
并建立串行线,启动shell,建立用户的初始环境。
<P>
部分初始化设置是输出文件<tt>/etc/motd</tt><A NAME="2310"> </A>(每天的短信息)的内容,
并检查电子邮件。可以在用户家目录中产生一个叫<tt>.hushlogin</tt><A NAME="2312"> </A>的文件来是上面
所述的失效。
<P>
如果存在文件<tt>/etc/nologin</tt><A NAME="2314"> </A>,就不允许登录。
这个文件一般由<tt>shutdown</tt><A NAME="2316"> </A>及其相关的东西产生。
<tt>login</tt><A NAME="2318"> </A>检查这个文件,如果这个文件存在,就拒绝接受登录。
如果这个文件确实存在,<tt>login</tt><A NAME="2320"> </A>就会在退出之前,将它的内容输出到终端。
<P>
<tt>login</tt><A NAME="2322"> </A>将所有失败的登录企图登记在系统log文件中
(通过<tt>syslog</tt><A NAME="2324"> </A>)。它也登记<em>所有</em>的<tt>root</tt>的登录。
这些都对跟踪入侵者有用。
<P>
当前登录着的用户列在<tt>/var/run/utmp</tt><A NAME="2326"> </A>中。
这个文件直到系统下次启动或关机前有效。系统刚启动时它被清空。
它列出了每个用户和用户使用的终端(或网络连接),及一些有用的信息。
<tt>who</tt><A NAME="2328"> </A>、<tt>w</tt><A NAME="2330"> </A>及
其他类似的命令查看<tt>utmp</tt><A NAME="2332"> </A>文件得到都有谁登录着。
<P>
所有成功的登录记录在<tt>/var/log/wtmp</tt><A NAME="2334"> </A>中。
这个文件将无限制地增大,所以必须有规律的清除,例如有个每周的<tt>cron</tt><A NAME="2336"> </A>任务
来清除它。
<A NAME="tex2html32" HREF="footnode.html#2219" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/footnode.html#2219"><IMG ALIGN=BOTTOM ALT="gif" SRC="foot_motif.gif" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/foot_motif.gif"></A>
<tt>last</tt><A NAME="2338"> </A>命令浏览<tt>wtmp</tt><A NAME="2340"> </A>文件。
<P>
<tt>utmp</tt><A NAME="2342"> </A>和<tt>wtmp</tt><A NAME="2344"> </A>都是二进制格式
(见<em>utmp</em><A NAME="2346"> </A>的man页);不幸的是,没有特殊的程序无法查看它们。
<P>
<HR><A NAME="tex2html1250" HREF="node77.html" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/node77.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="next_motif.gif" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/next_motif.gif"></A> <A NAME="tex2html1248" HREF="node73.html" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/node73.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="up_motif.gif" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/up_motif.gif"></A> <A NAME="tex2html1242" HREF="node75.html" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/node75.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="previous_motif.gif" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/previous_motif.gif"></A> <A NAME="tex2html1252" HREF="node1.html" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/node1.html"><IMG WIDTH=65 HEIGHT=24 ALIGN=BOTTOM ALT="contents" SRC="contents_motif.gif" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/contents_motif.gif"></A> <A NAME="tex2html1253" HREF="node108.html" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/node108.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="index_motif.gif" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/index_motif.gif"></A> <BR>
<B> Next:</B> <A NAME="tex2html1251" HREF="node77.html" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/node77.html">X and xdm</A>
<B>Up:</B> <A NAME="tex2html1249" HREF="node73.html" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/node73.html">Logging In And Out</A>
<B> Previous:</B> <A NAME="tex2html1243" HREF="node75.html" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/node75.html">Logins via the network</A>
<P><ADDRESS>
<I>Lars Wirzenius <BR>
Sun Jun 29 13:31:22 EEST 1997</I>
</ADDRESS>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -