vsftpd限制用户不能更改根目录

在IE下登陆会出现如下图所示情况,当时直接吓尿了,尼玛这台危险了。仔细一想可定是在配置vsftpd.conf时没有设置用户不能更改根目录

仔细一看果然:

[root@Ric01 ~]# cat /etc/vsftpd/vsftpd.conf | grep chroot
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
#chroot_local_user=YES
chroot_list_enable=NO    #果不其然设置值为:no
#chroot_list_file=/etc/vsftpd/chroot_list

修改vsftpd.conf,改好之后如下:

[root@centos6 ~]# cat /etc/vsftpd/vsftpd.conf | grep chroot
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
#chroot_local_user=YES
chroot_list_enable=YES        #由NO改为YES
#chroot_list_file=/etc/vsftpd/chroot_list

重启服务登录测试,出现如下问题:

500 OOPS: could not read chroot() list file:/etc/vsftpd/chroot_list
500 OOPS: priv_sock_get_result

提示信息表明在:/etc/vsftpd/下没有chroot_list文件,创建chroot_list文件,并在文件中加入不允许修改根目录的用户名(一行一和用户):

[root@centos6 ~]# vi /etc/vsftpd/chroot_list

admin
stu

继续登录测试--> 成功:

参考致谢:http://www.cnblogs.com/redhatlinux/archive/2012/04/11/2442782.html

posted @ 2014-04-22 12:25  谢佳东/馨予希  阅读(1289)  评论(0编辑  收藏  举报