免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2882 | 回复: 2
打印 上一主题 下一主题

HP主机如何限定FTP用户查看目录,同时禁止FTP用户telnet-----求助! [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-03-25 11:53 |只看该作者 |倒序浏览
环境:HP-UX cbcms1 B.11.11 U 9000/800 299594908 unlimited-user license

问题:
为一个应用建一个FTP用户  test ,根目录/home/test ,

本意是test用户不能telnent,
并且FTP登录后只能在/home/test 下进行操作,不能看到上级目录。

上网找了很久都没有找到方法,有没有达人帮帮忙~~~~


[ 本帖最后由 wjldlr 于 2008-3-25 11:55 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2008-03-25 14:44 |只看该作者
网上找到一个可应方法,供参考!

----------------------------------------------------------------------------------------------
假设要在系统中建立一个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下通过

论坛徽章:
0
3 [报告]
发表于 2008-03-25 21:50 |只看该作者
好帖子,支持一个!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP