|
 |
栏目导栏 |
|
| |
|
|
|
|
 |
资料搜索 |
|
| |
|
|
|
|
 |
热门文章 |
|
| |
|
|
|
|
 |
最新文章 |
|
| |
|
|
|
| |
| |
|
|
|
|
如何建立一个只归属于某个目录下的ftp账户?如ftptest通过ftp登陆到系统时, RE6Linux联盟 系统认为/home/ftptest就是他的根(/)。 RE6Linux联盟 RE6Linux联盟 以下方法在hpux11下测试通过,如在hpux下实现此功能,需要安装wu_ftp这个软 RE6Linux联盟 件,或者更新你的ftp。 RE6Linux联盟 RE6Linux联盟 假设要在系统中建立一个ftptest(属于ftptest组),要想在它ftp的时候始终在 RE6Linux联盟 /home/ftptest目录以及它的子目录下。下面是他的建立步骤。 RE6Linux联盟 RE6Linux联盟 1。在/etc/passwd中建立相应的ftptest条目,注意他的主目录的写法: RE6Linux联盟 ftptest:Aci$xi:555:555:ftp user for chroot:/home/ftptest/./:/bin/ksh RE6Linux联盟 (确信/etc/shells中有/bin/ksh,否则请加上,密码由你自己决定 ) RE6Linux联盟 2。在/etc/passwd中建立相应的组ftptest RE6Linux联盟 ftptest::555:ftptest RE6Linux联盟 3。建立/home/ftptest以及相应的目录(主要是~ftp/usr/bin和~/ftp/etc) RE6Linux联盟 #mkdir /home/ftptest RE6Linux联盟 #chown ftptest:ftptest /home/ftptest RE6Linux联盟 #su - ftptest RE6Linux联盟 $pwd //make sure it is under /home/ftptest RE6Linux联盟 $mkdir -p usr/bin RE6Linux联盟 $cp /sbin/ls usr/bin ; cp /bin/pwd usr/bin RE6Linux联盟 $mkdir etc RE6Linux联盟 $cp /etc/passwd etc ; cp /etc/group etc (为了安全,你需要修改passwd中 RE6Linux联盟 不必要的项,如root) RE6Linux联盟 4。编辑/etc/inetd.conf RE6Linux联盟 确信ftp的那一行是这样写的: RE6Linux联盟 ftp stream tcp nowait root /usr/lbin/ftpd ftp -l -a (一定要加上 -a 这 RE6Linux联盟 个参数) RE6Linux联盟 5。重新初始化inetd : 执行: inetd -c RE6Linux联盟 6。产生相应的ftpaccess/ftpgroups文件 RE6Linux联盟 #cd /etc/ftpd RE6Linux联盟 #touch ftpgroups RE6Linux联盟 #vi ftpaccess //这个文件的内容大致如下: RE6Linux联盟 RE6Linux联盟 -=-=-=-=-= Cut Here =-=-=-=-=- RE6Linux联盟 class all real,guest,anonymous * RE6Linux联盟 RE6Linux联盟 # Define the line that limits the ftponly group to their own directories RE6Linux联盟 RE6Linux联盟 # in the ftp-root heirarchy. RE6Linux联盟 guestgroup ftptest //这里要和你的组ftptest一致。 RE6Linux联盟 RE6Linux联盟 email xmli@szdhd.sz.lucent.com //这里用你自己的email地址 RE6Linux联盟 RE6Linux联盟 loginfails 5 RE6Linux联盟 RE6Linux联盟 readme README* login RE6Linux联盟 readme README* cwd=* RE6Linux联盟 RE6Linux联盟 message /welcome.msg login RE6Linux联盟 message .message cwd=* RE6Linux联盟 RE6Linux联盟 compress yes all RE6Linux联盟 tar yes all RE6Linux联盟 chmod no guest,anonymous RE6Linux联盟 delete no guest,anonymous RE6Linux联盟 overwrite no guest,anonymous RE6Linux联盟 rename no guest,anonymous RE6Linux联盟 RE6Linux联盟 log transfers anonymous,real inbound,outbound RE6Linux联盟 RE6Linux联盟 shutdown /etc/shutmsg RE6Linux联盟 RE6Linux联盟 passwd-check rfc822 warn RE6Linux联盟 RE6Linux联盟 -=-=-=-=-= Cut Here =-=-=-=-=- RE6Linux联盟 RE6Linux联盟 7。好了,okay了,你可以测试是否正确,我已在hpux11下通过(B2000)。
Linux联盟收集整理 ,转贴请标明原始链接,如有任何疑问欢迎来本站Linux论坛讨论 |
|
|
|
|
|