找回密码
 注-册

QQ登录

只需一步,快速开始

查看: 5888|回复: 0

vsftp 限制用户目录,不得改变目录到上级

[复制链接]
发表于 2009-8-18 12:38:29 | 显示全部楼层 |阅读模式
如何让特定使用者peter、john 不得变更目录
使用者的预设目录为/home/username,若是我们不希望使用者在ftp 时能够
切换到上一层目录/home,则可参考以下步骤。

Step1. 修改/etc/vsftpd/vsftpd.conf
将这两行
#chroot_list_enable=YES
#chroot_list_file=/etc/vsftpd.chroot_list
注释去掉
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list

Step2. 新增一个文件: /etc/vsftpd/chroot_list
内容写需要限制的用户名:
peter
john

Step3. 重新启动vsftpd
[root@home vsftpd]# /sbin/service vsftpd restart
Shutting down vsftpd: OK ]
Starting vsftpd for vsftpd: OK ]

若是peter 欲切换到根目录以外的目录,则会出现以下警告:
ftp> cd /home
550 Failed to change directory.
您需要登录后才可以回帖 登录 | 注-册

本版积分规则

Archiver|手机版|小黑屋|数码鹭岛 ( 闽ICP备20006246号 )

counter

GMT+8, 2026-1-24 08:44 , Processed in 0.080556 second(s), 22 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表