免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1769 | 回复: 0

在HP-UX下建立只归属于某个目录下的ftp账户 [复制链接]

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


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/38775/showart_413507.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP