⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 node86.html

📁 Linux帮助文档之系统管理员手册
💻 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>Creating a user by hand</title>
<meta NAME="description" CONTENT="Creating a user by hand">
<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="tex2html1379" HREF="node87.html"><img WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" ALT="next" SRC="./next_motif.gif"></a> <a NAME="tex2html1377" HREF="node82.html"><img WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" ALT="up" SRC="./up_motif.gif"></a> <a NAME="tex2html1373" HREF="node85.html"><img WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" ALT="previous" SRC="./previous_motif.gif"></a> <a NAME="tex2html1381" HREF="node1.html"><img WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" ALT="contents" SRC="./contents_motif.gif"></a> <a NAME="tex2html1382" HREF="node108.html"><img WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" ALT="index" SRC="./index_motif.gif"></a> <br>
<b> Next:</b> <a NAME="tex2html1380" HREF="node87.html">Changing user properties</a>
<b>Up:</b> <a NAME="tex2html1378" HREF="node82.html">Creating a user</a>
<b> Previous:</b> <a NAME="tex2html1374" HREF="node85.html">Initial environment: /etc/skel</a>
<br> <p>
<h2><a NAME="SECTION00924000000000000000">手工创建用户</a></h2>
<a NAME="subsecmanualadduser">&nbsp;</a>
<p>
按以下步骤手工创建新用户:
	<ol>
<li>用<tt>vipw</tt><a NAME="2508">&nbsp;</a>(8)编辑<tt>/etc/passwd</tt><a NAME="2506">&nbsp;</a>,
为新用户增加一个新行。注意语法。
<em>不要用编辑器直接编辑!</em> <tt>vipw</tt><a NAME="2510">&nbsp;</a>锁定了这个文件,其他命令这时不能更新它。
设定口令域为&quot;<tt>*</tt>&quot;,这样不能登录。
<li>类似,如果要创建新组,用<tt>vigr</tt><a NAME="2514">&nbsp;</a>编辑<tt>/etc/group</tt><a NAME="2512">&nbsp;</a>。
<li>用<tt>mkdir</tt><a NAME="2516">&nbsp;</a>产生用户的家目录。 
<li>将<tt>/etc/skel</tt><a NAME="2518">&nbsp;</a>中的文件复制到新的家目录中。
<li>用<tt>chown</tt><a NAME="2520">&nbsp;</a>和<tt>chmod</tt><a NAME="2522">&nbsp;</a>修改所有者和权限。
<tt>-R</tt>选项是最有用的。
The correct permissions vary a little from one site to another, but usually the following commands do the right thing:
<blockquote> <tt>
cd <i>/home/newusername</i> <br> 
chown -R <i>username.group</i> . <br> 
chmod -R go=u,go-w . <br> 
chmod go= .
</tt></blockquote>
<li>用<tt>passwd</tt><a NAME="2524">&nbsp;</a>(1)设定口令。
	</ol>
<p>
最后一步设定完口令,这个帐户就能用了。不应该在其他所有事做完之前设定口令,否则这个用户可能不允许登录while you're still copying the files.
<p>
有时需要产生不为任何人使用的虚假(dummy)帐户<a NAME="tex2html35" HREF="footnode.html#2432"><img ALIGN="BOTTOM" ALT="gif" SRC="./foot_motif.gif" WIDTH="15" HEIGHT="15"></a>
例如,建立一个匿名FTP服务器(这样任何人都可以从它下载文件,无须得到一个帐户),必须产生一个叫<tt>ftp</tt>的帐户。
这种情况,通常无须随后一步的口令设定。而且,最好不设,这样没有人可以使用这个帐户,除非先变成<tt>root</tt>,因为<tt>root</tt>可以变成任何用户。
<p>
<hr><a NAME="tex2html1379" HREF="node87.html"><img WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" ALT="next" SRC="./next_motif.gif"></a> <a NAME="tex2html1377" HREF="node82.html"><img WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" ALT="up" SRC="./up_motif.gif"></a> <a NAME="tex2html1373" HREF="node85.html"><img WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" ALT="previous" SRC="./previous_motif.gif"></a> <a NAME="tex2html1381" HREF="node1.html"><img WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" ALT="contents" SRC="./contents_motif.gif"></a> <a NAME="tex2html1382" HREF="node108.html"><img WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" ALT="index" SRC="./index_motif.gif"></a> <br>
<b> Next:</b> <a NAME="tex2html1380" HREF="node87.html">Changing user properties</a>
<b>Up:</b> <a NAME="tex2html1378" HREF="node82.html">Creating a user</a>
<b> Previous:</b> <a NAME="tex2html1374" HREF="node85.html">Initial environment: /etc/skel</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 + -