node76.html
来自「Linux帮助文档之系统管理员手册」· HTML 代码 · 共 61 行
HTML
61 行
<!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="tex2html1250" HREF="node77.html"><img WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" ALT="next" SRC="./next_motif.gif"></a> <a NAME="tex2html1248" HREF="node73.html"><img WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" ALT="up" SRC="./up_motif.gif"></a> <a NAME="tex2html1242" HREF="node75.html"><img WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" ALT="previous" SRC="./previous_motif.gif"></a> <a NAME="tex2html1252" HREF="node1.html"><img WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" ALT="contents" SRC="./contents_motif.gif"></a> <a NAME="tex2html1253" HREF="node108.html"><img WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" ALT="index" SRC="./index_motif.gif"></a> <br>
<b> Next:</b> <a NAME="tex2html1251" HREF="node77.html">X and xdm</a>
<b>Up:</b> <a NAME="tex2html1249" HREF="node73.html">Logging In And Out</a>
<b> Previous:</b> <a NAME="tex2html1243" HREF="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"><img ALIGN="BOTTOM" ALT="gif" SRC="./foot_motif.gif" WIDTH="15" HEIGHT="15"></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"><img WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" ALT="next" SRC="./next_motif.gif"></a> <a NAME="tex2html1248" HREF="node73.html"><img WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" ALT="up" SRC="./up_motif.gif"></a> <a NAME="tex2html1242" HREF="node75.html"><img WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" ALT="previous" SRC="./previous_motif.gif"></a> <a NAME="tex2html1252" HREF="node1.html"><img WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" ALT="contents" SRC="./contents_motif.gif"></a> <a NAME="tex2html1253" HREF="node108.html"><img WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" ALT="index" SRC="./index_motif.gif"></a> <br>
<b> Next:</b> <a NAME="tex2html1251" HREF="node77.html">X and xdm</a>
<b>Up:</b> <a NAME="tex2html1249" HREF="node73.html">Logging In And Out</a>
<b> Previous:</b> <a NAME="tex2html1243" HREF="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 + =
减小字号Ctrl + -
显示快捷键?