📄 1710.html
字号:
<br>
<br>
<br>
然後启动 ypbind: ypbind <br>
(或者/etc/rc.d/init.d/ypbind restart) <br>
<br>
<br>
测试 NIS <br>
<br>
在客户端上面以 root 身份登录之後请输入 ypcat passwd <br>
<br>
<br>
看看 server 端的帐号是否被列出来了。 <br>
<br>
您也可以执行 getent passwd netman <br>
<br>
<br>
这里的‘netman’是在 NIS 伺服器上面的一个使用者帐号名称请改成您欲查询的帐号。这个命令的作用是让我们确定该帐号出现在 NIS 登录之中。如果您看不到任何信息回应那麽好可能上面的步骤(包括伺服器和客户端)还没正确完成您则需要找出原因所在。 <br>
<br>
如果您能得到信息回应例如 netman:x:1001:1001::/home/netman:/bin/bash <br>
<br>
<br>
<br>
<br>
那是好消息否则您得从头进行 debug 方好继续。 <br>
<br>
然後输入 yppasswd netman <br>
Please enter root passwd: <br>
Please enter new passwd: <br>
Please retype password: <br>
(#注意: 最後两行是设定 netman 的 NIS password。最好和原来的密码一致因为原来的密码也会被更改为 nis 的密码。) <br>
<br>
其实上面这步不是必须的如果您能够从另外的机器用 NIS帐号登录就可以略过此步骤。 <br>
<br>
接着请在本地主机上面建立起该使用者的家目录 mkdir /home/netman <br>
chown netman:netman /home/netman <br>
<br>
<br>
当然了您也可以设定 Linux 在开机的时候通过 NFS 挂载到使用者原本的家目录(tips修改 /etc/fstab)。但如何做您自己去尝试吧这里暂时卖个关子。 <br>
<br>
如果该使用者需要使用到本机上面的邮件系统也请为之建立信箱 touch /var/spool/mail/netman <br>
chown netman:mail /var/spool/mail/netman <br>
chmod 660 /var/spool/mail/netman <br>
<br>
<br>
这样您就可以使用 NIS 登录了。 <br>
<br>
当您有新的使用者增加之後欲加入 NIS 中的话您要先 cd /var/yp 然後执行 make 来更新 nis 资料。如果登录失败重新启动 yppasswdd 服务然後用 yppasswd 来设定他/她的 NIS 密码但要注意一点原使用者帐号必须已经设定过密码管此时可以取而代之为新的密码。然而有趣的是之後您再於原来主机上更改原帐号的密码却不会影响 NIS 的哦。 <br>
<br>
如果还有问题您要检查一下 server 端的 ypserv 和 yppasswdd以及 client 端的 ypbind 是否被启动成功(tips执行rpcinfo -p尤其注意 yppasswdd)。其中portmap 是一个很重要的服务(有些系统会显示为 rpcbind)在您执行 ypserv 和 yppasswdd 之前要确定它已经被启动了。如果您需要重启 portmap 要确定所有基於它的服务也要重新启动。 <br>
<br>
同时留意一下 client 和 server 的 NIS domain name 是否一致。必要时您或许要执行/usr/lib/yp/ypinit -m重新建立 ypserv 资料但这样您就需要重新执行 yppasswd 来设定使用者的 NIS 密码了。 <br>
<br>
设定 NIS在 server 端牵涉的档案比较多诸如 rpcportmapypnsswitch等等。您可以看一下关於 NIS 的HOWTO 文章或相关的 manuals。 <br>
<br>
另有一篇和网友的讨论文章我也觉得蛮值得参考一下的: <br>
<br>
wkhuang wrote in message <br>
news:3aZSaR$GvO@bbs.cis.nctu.edu.tw... <br>
> ==> 在 "网中人" 的文章中提到: <br>
> > 2000/05/28 <br>
> > 网中人今天对 NIS 系统再进行测试。对原来的文章做了小小修改主要是针对测 <br>
试过 <br>
> > 程中需要注意的地方增加了说明。希望读者留意和共同参与测试。 <br>
> > http://pds.nchu.edu.tw/study_area/linux/linux_nfs.htm <br>
> <br>
> 不知您可否测试一下redhat6.2上yp之後,finger有个小bug。 <br>
> 比如同一台电脑是yp server, 也是yp client. <br>
<br>
抱歉因为弟还的 RH6.2 还没安装或许过两天再测试吧。 <br>
<br>
> 在建立yp帐号时,若依照你的方法,你的yp map database的来源,应该是在 <br>
> /etc下的一些档案, 主要就是/etc/passwd,/etc/shadow, /etc/group, <br>
/etc/gshadow <br>
<br>
嗯的确如此修改 /var/yp/Makefile 里面的参数可以改变预设内容。 <br>
<br>
> (其实这样不太好,因为这样root,和一些根本不该上yp的帐号都跟着进去了,建议去 <br>
> 改/var/yp/Makefile中更改YPPWDDIR = /etc改为某个另外的目录,并将几个 <br>
> 档, 如passwd, shadow, group, gshadow拷过去,并只留你想让他上yp的帐号和 <br>
> group) <br>
<br>
您的建议非常好。不过在弟的 RH6.0 上面 (後面的测试相同) <br>
ypcat passwd 只会显示 uid 500 以上的使用者不知道是否正常呢 <br>
<br>
> <br>
> 我遇到的finger的bug(或是linux yp的bug,描述如下) <br>
> <br>
> 若yp map database的来源仍如网中人例中的/etc目录 <br>
> 1. 首先先在/etc/passwd和/etc/shadow中建立一个使用者帐号user1, <br>
> 试着把他的fullname 栏位设为空白,就是:: <br>
<br>
这可以用 useradd 来做。 <br>
<br>
> 2. 之後让他进入yp的map database,若是已在yp server跑起来之後,应该是 <br>
> 到/var/yp下执行make以更新yp map database(这才是正确的) <br>
<br>
对。如果是第一次可以执行 /usr/lib/yp/ypinit -m 。 <br>
<br>
> 3. 要砍掉原本/etc/passwd和/etc/shadow中的user1帐号记录,确定local端 <br>
> 无此帐号,由YP Server取得。 <br>
<br>
只要执行过 make 就可以这样做了。 <br>
但风险是假如日後增加使用者重新执行 make 的话 <br>
这个帐号在 NIS 中也会消失掉。 <br>
<br>
使用您刚才的建议(即另设 YPPWDDIR ) <br>
在技术上可以化解这个顾虑 <br>
但必须手工的修改 passwd 档而不能单纯的 copy 了。 <br>
<br>
> 4. 测试user1帐号确定可以登入 <br>
<br>
嗯在我的测试中还必须使用 yppasswd user1 设定密码之後才行 <br>
而且原帐号也必须已经经过密码设定。 <br>
<br>
> 5. 但在这台server兼client上执行finger user1,竟会造成Segmentation <br>
> fault (core dumped),跑不出正确结果 <br>
<br>
在我的测试中这个在 client 端执行会出现。 <br>
但在 sever 端则工作正常当然了我这台 server 并没有作为其它 server 的 <br>
client 。 <br>
但测试过 ypbind 向自己(从 ypwhich 可以确定)也没问题。 <br>
<br>
> <br>
> 後来我依上述方式重建user1帐号,但是full name栏位这次填字进去。 <br>
> finger user1命令就正常了。 <br>
<br>
这个在我的测试中并没有什麽影响和以前的测试一样 <br>
client 端出现 Segmentation fault (core dumped)。 <br>
<br>
> 我试过solaris 2.6, 7, 没这个问题.. :) <br>
> 也试着抓gun finger 1.37.tar.gz要下来装看看, 无奈功力不足, 就是 <br>
> make 不成 <br>
> <br>
> 有否高手能指点一二呢 <br>
<br>
对不起小弟绝非高手。 <br>
对 NIS 也不熟许多测试还是看到您的回应才(会得)进行。 <br>
<br>
不过倒非常乐意有其它更有经验的朋友一起来探讨一下。 <br>
<br>
非常多谢您的 feedback <br>
<br>
<br>
<br>
</FONT><br>
</TD>
</TR>
<TR>
<TD colSpan=2><FONT
class=middlefont></FONT><BR>
<FONT
class=normalfont>全文结束</FONT> </TD>
</TR>
<TR>
<TD background="images/dot.gif" tppabs="http://www.linuxhero.com/docs/images/dot.gif" colSpan=2
height=10></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></DIV></TD>
<TD vAlign=top width="20%"
background="images/line.gif" tppabs="http://www.linuxhero.com/docs/images/line.gif" rowSpan=2>
<DIV align=center>
<table class=tableoutline cellspacing=1 cellpadding=4
width="100%" align=center border=0>
<tr class=firstalt>
<td noWrap background="images/bgline.gif" tppabs="http://www.linuxhero.com/docs/images/bgline.gif" colspan=2 height=21>
<font class=normalfont><b>所有分类</b></font></td>
</tr>
<tr class=secondalt> <td noWrap width=27%> <font class=normalfont>1:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type1.html" tppabs="http://www.linuxhero.com/docs/type1.html">非技术类</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>2:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type2.html" tppabs="http://www.linuxhero.com/docs/type2.html">基础知识</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>3:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type3.html" tppabs="http://www.linuxhero.com/docs/type3.html">指令大全</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>4:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type4.html" tppabs="http://www.linuxhero.com/docs/type4.html">shell</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>5:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type5.html" tppabs="http://www.linuxhero.com/docs/type5.html">安装启动</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>6:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type6.html" tppabs="http://www.linuxhero.com/docs/type6.html">xwindow</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>7:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type7.html" tppabs="http://www.linuxhero.com/docs/type7.html">kde</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>8:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type8.html" tppabs="http://www.linuxhero.com/docs/type8.html">gnome</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>9:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type9.html" tppabs="http://www.linuxhero.com/docs/type9.html">输入法类</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>10:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type10.html" tppabs="http://www.linuxhero.com/docs/type10.html">美化汉化</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>11:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type11.html" tppabs="http://www.linuxhero.com/docs/type11.html">网络配置</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>12:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type12.html" tppabs="http://www.linuxhero.com/docs/type12.html">存储备份</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>13:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type13.html" tppabs="http://www.linuxhero.com/docs/type13.html">杂项工具</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>14:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type14.html" tppabs="http://www.linuxhero.com/docs/type14.html">编程技术</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>15:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type15.html" tppabs="http://www.linuxhero.com/docs/type15.html">网络安全</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>16:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type16.html" tppabs="http://www.linuxhero.com/docs/type16.html">内核技术</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>17:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type17.html" tppabs="http://www.linuxhero.com/docs/type17.html">速度优化</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>18:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type18.html" tppabs="http://www.linuxhero.com/docs/type18.html">apache</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>19:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type19.html" tppabs="http://www.linuxhero.com/docs/type19.html">email</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>20:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type20.html" tppabs="http://www.linuxhero.com/docs/type20.html">ftp服务</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>21:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type21.html" tppabs="http://www.linuxhero.com/docs/type21.html">cvs服务</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>22:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type22.html" tppabs="http://www.linuxhero.com/docs/type22.html">代理服务</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>23:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type23.html" tppabs="http://www.linuxhero.com/docs/type23.html">samba</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>24:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type24.html" tppabs="http://www.linuxhero.com/docs/type24.html">域名服务</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>25:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type25.html" tppabs="http://www.linuxhero.com/docs/type25.html">网络过滤</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>26:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type26.html" tppabs="http://www.linuxhero.com/docs/type26.html">其他服务</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>27:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type27.html" tppabs="http://www.linuxhero.com/docs/type27.html">nfs</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>28:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type28.html" tppabs="http://www.linuxhero.com/docs/type28.html">oracle</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>29:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type29.html" tppabs="http://www.linuxhero.com/docs/type29.html">dhcp</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>30:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type30.html" tppabs="http://www.linuxhero.com/docs/type30.html">mysql</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>31:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type31.html" tppabs="http://www.linuxhero.com/docs/type31.html">php</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>32:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type32.html" tppabs="http://www.linuxhero.com/docs/type32.html">ldap</a></font></td> </tr> </table></td></tr> </table>
</DIV></TD></TR>
<TR vAlign=top>
<TD width="80%">
<DIV align=center><BR>
</DIV>
</TD></TR></TBODY></TABLE></TD></TR>
</TABLE></TD></TR>
</TABLE>
<TABLE cellSpacing=0 cellPadding=4 width="100%" bgColor=#eeeeee
border=0><TBODY>
<TR>
<TD width="50%">
<P><FONT class=middlefont>版权所有 © 2004 <A
href="mailto:bjchenxu@sina.com">linux知识宝库</A><BR>
违者必究. </FONT></P>
</TD>
<TD width="50%">
<DIV align=right><FONT class=middlefont>Powered by: <A
href="mailto:bjchenxu@sina.com">Linux知识宝库</A> Version 0.9.0 </FONT></DIV>
</TD></TR></TBODY></TABLE>
<CENTER></CENTER></TD></TR>
</TABLE></CENTER></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -