vsftpd限制用户不能更改根目录
时间:2015-07-12 02:20 来源:linux.it.net.cn 作者:IT
在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
继续登录测试--> 成功:
(责任编辑:IT)
在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 继续登录测试--> 成功:
(责任编辑:IT) |