免费注册 查看新帖 |

Chinaunix

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

[FTP] ftp用户登陆后,如何设定只能看到提定的目录? red hat ent 5.4 vsftpd [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-01-23 14:50 |只看该作者 |倒序浏览
本帖最后由 lvtao_cn 于 2011-01-23 14:51 编辑

开启vsftpd 服务器后
如果用FTP客户端(cuteftp) 的匿名登录后, 发现 "/" 根目录是 /var/ftp/  并且只能看到/var/ftp 以下的目录及文件,其它的文件都看不到。

现在我自建一个ftp 用户

useradd -g ftp -s /sbin/nologin  -d  /app/tony   tony   
注:建用户tony , 目录为/app/tony  ,不允许 登录 linux

passwd tony ...并设置了密码!

现在呢,用   FTP客户端(cuteftp) 的匿名登录后, 发现 登录后的目录是 /app/tony ,
但是 可以看到/etc,/dev/....等等服务器上所有的文件   

请问有无办法,让tony 用户只能看到/app/tony 下所以的文件,其它任何文件都不能列出来,即像匿名登录一样??


cat vsftd.conf

# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=YES
#
# Uncomment this to allow local users to log in.
local_enable=YES
#
# Uncomment this to enable any form of FTP write command.
write_enable=YES
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
local_umask=022
dirmessage_enable=YES

xferlog_std_format=YES
listen=YES

pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES

论坛徽章:
0
2 [报告]
发表于 2011-01-23 16:49 |只看该作者
lz的需求应该是虚拟用户吧.
http://blog.365online.me/show.php?id=17

论坛徽章:
34
亥猪
日期:2015-03-20 13:55:11戌狗
日期:2015-03-20 13:57:01酉鸡
日期:2015-03-20 14:03:56未羊
日期:2015-03-20 14:18:30子鼠
日期:2015-03-20 14:20:14丑牛
日期:2015-03-20 14:20:31辰龙
日期:2015-03-20 14:35:34巳蛇
日期:2015-03-20 14:35:56操作系统版块每日发帖之星
日期:2015-11-06 06:20:00操作系统版块每日发帖之星
日期:2015-11-08 06:20:00操作系统版块每日发帖之星
日期:2015-11-19 06:20:00黄金圣斗士
日期:2015-11-24 10:43:13
3 [报告]
发表于 2011-01-23 16:51 |只看该作者
  1. # You may specify an explicit list of local users to chroot() to their home
  2. # directory. If chroot_local_user is YES, then this list becomes a list of
  3. # users to NOT chroot().
  4. chroot_list_enable=YES
  5. # (default follows)
  6. #chroot_list_file=/etc/vsftpd.chroot_list
复制代码

论坛徽章:
0
4 [报告]
发表于 2011-02-09 14:10 |只看该作者
去看看虚拟用户,然后给虚拟用户建立一个登陆权限的文件就OK了

论坛徽章:
0
5 [报告]
发表于 2011-02-23 22:07 |只看该作者
chroot_list_enable = YES
chroot_list_file = /etc/vsftpd/chroot_list

在list文件里写上你需要禁锢的用户名

论坛徽章:
381
CU十二周年纪念徽章
日期:2014-01-04 22:46:58CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55CU大牛徽章
日期:2013-04-17 11:17:19CU大牛徽章
日期:2013-04-17 11:17:32CU大牛徽章
日期:2013-04-17 11:17:37CU大牛徽章
日期:2013-04-17 11:17:42CU大牛徽章
日期:2013-04-17 11:17:47CU大牛徽章
日期:2013-04-17 11:17:52CU大牛徽章
日期:2013-04-17 11:17:56
6 [报告]
发表于 2011-02-24 08:38 |只看该作者
配置chroot_list_enable=YES
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP