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

转载于:https://www.cnblogs.com/Richard-xie/p/3680240.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值