500 OOPS: vsftpd: refusing to run with writable root inside chroot()解决方法
# setsebool -P ftpd_full_access=on
FTP连接时报错如下:
500 OOPS: vsftpd: refusing to run with writable root inside chroot()
解决方法:
chroot_local_user=YES ---锁定用户登录ftp后,只能到自己的家目录下,不能随便切换到其它目录。但是普通系统用户默认是可以在自己的家目录里写文件的,vsftp出于安全性要求,
如果锁定了用户的ftp登录目录,则所在目录不能有写权限。
方法1、 /etc/vsftpd/vsftpd.conf配置文件增加如下一行
local_root=/data/ftp //系统用户登录后进入到该目录,注意该目录对其它用户同样不能有写的权限。(连写入的权限都没有,这个方法也不靠谱)
如果有写权限,则执行chroot a-w /var/ftp -R 取消写入权限。
方法2、简单粗暴的方法
不要设置local_root参数,取消用户往自己目录写权限: chmod a-w /home/username,但是用户登录操作系统后会影响用户使用,自己目录写的权限都没有。--不可行。
方法3、/etc/vsftpd/vsftpd.conf配置文件增加如下一行
allow_writeable_chroot=YES --可行。ftp目录必须要有写权限。
方法4、添加例外
/etc/vsftpd/chroot_list 这个配置文件中加入用户名
修改完配置文件事要重启vsftpd服务。
==============
听起来有点绕,按下面的配置就没问题了:
#chmod o-w /data/ftp
vi /etc/vsftpd/vsftpd.conf 修改下面三行。
chroot_local_user=YES --锁定ftp用户目录。不能随便切换到其它目录。
local_root=/data/ftp ---指定用户登录后的目录。或者不指定也行,系统用户登录ftp后,直接到用户自己的家目录。
allow_writeable_chroot=yes
如果要添加例外,即允许某个用户可以切换到其它目录,则添加下面两行参数,否则可以不用配置。
chroot_list_enable= YES --这个是启用用户列表,对应下一句的chroot_list文件。
chroot_list_file=/etc/vsftpd/chrot_list ---在这个文件中的用户则不受限制,可以切换到其它目录。这个文件需要手动创建。
这样,FTP用户登录后,只能在指定目录下进行读写操作,不能随便切换到其它目录。
============
参考:
The problem is that your users root directory is writable, which isn’t allowed when using chroot restrictions in the new update.
To fix this you must either remove write permissions on the users root directory with the following command, replacing the directory with your users root:
chmod a-w /home/user
Or you can work around this security check by adding either of the two below into your configuration file.
For the standard vsFTPd build (vsftpd):
allow_writeable_chroot=YES
For the extended vsFTPd build (vsftpd-ext):
allow_writable_chroot=YES
Removing the write permission on the root isn’t a perfect solution as doing this can cause a few problems with things that need to write to the root directory, such as the bash history file or some graphical environments.
=========================
另外一种可行的配置方法:
(这个方法总比你让所有用户都有写入权限o+w要安全得多)
配置如下:
chroot_local_user=YES
local_root=/data/ftp
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list
使用root 帐号执行如下命令:
# setfacl -m u:用户名:rwx /data/ftp ---使用该命令来设置指定用户的acl权限,允许指定的用户可写,其它用户不可写。
#chmod o-w /data/ftp --取消对比所有用户可写。
#systemctl restart vsftpd
500 OOPS: vsftpd: refusing to run with writable root inside chroot()解决方法的更多相关文章
- vsftpd:500 OOPS: vsftpd: refusing to run with writable root inside chroot ()错误的解决方法
---恢复内容开始--- 最近在安装了vsftpd后 添加了虚拟账户后 新建用户 为新用户创立独立的工作目录 因为虚拟用户在工作目录需要上传文件 所以必须拥有此目录的W权限,但每当给此目录加上W权限后 ...
- 500 OOPS: vsftpd: refusing to run with writable root inside chroot()
Ubuntu 12.04 64bit系统下安装的vsftpd,在登陆时提示500 OOPS: vsftpd: refusing to run with writable root inside chr ...
- 【转】vsftp 遇到错误 500 OOPS: vsftpd: refusing to run with writable root inside chroot()--不错
原文网址:http://linux.it.net.cn/e/server/ftp/2015/0227/13554.html 当我们限定了用户不能跳出其主目录之后,使用该用户登录FTP时往往会遇到这个错 ...
- 500 OOPS: vsftpd: refusing to run with writable root inside chroot () 不能上传文件和文件夹
500 OOPS: vsftpd: refusing to run with writable root inside chroot () 问题的是因为用户的根目录可写,并且使用了chroot限制,而 ...
- vsftpd.service: Main process exited, code=exited, status=2/INVALIDARGUMENT和vsftpd:500 OOPS: vsftpd: refusing to run with writable root inside chroot ()错误的解决方法
今天在配置VSFTPD过程中遇到两个错误 1是启动失败,通过 SERVICE VSFTPD STATUS 查看到报错 May 02 16:06:58 debian systemd[1]: Starti ...
- 响应: 500 OOPS: vsftpd: refusing to run with writable root inside chroot()
原vsftpd服务器的系统从centos6.8升级到centos7.2.vsftpd使用yum方式安装,用户采用系统用户登录.由于系统升级到centos7,yum安装的vsftpd版本改变.因此按ce ...
- ubuntu 14.04 下FTP服务器的搭建--锁定用户目录,解决vsftpd: refusing to run with writable root inside chroot()
FTP服务器的搭建,我要实现的需求是: 不允许匿名访问,因为我的机器不想让谁都能登录上来,随便获取文件, 需要锁定一个目录,因为在家里,我需要给媳妇下载一些电影 韩剧之类的东西,媳妇会来我机器下载,但 ...
- 500 OOPS: vsftpd: refusing to run with writable anonymous root
500 OOPS: vsftpd: refusing to run with writable anonymous root 以下就是解决的三个步骤,其中第一步,是我一直没有搞明白的,也是其中的重点: ...
- 解决vsftpd的refusing to run with writable root inside chroot错误
参考 http://www.cnblogs.com/CSGrandeur/p/3754126.html 在Ubuntu下用 vsftpd 配置FTP服务器,配置 “ sudo chmod a-w /h ...
随机推荐
- dede定义全局变量(include/common.inc.php)及调用方式
dede定义全局变量的文件include/common.inc.php及使用 在include/common.inc.php文件里,dede定义了大量的全局变量,详细自己去看看 dede模板里 ...
- Flask_SqlAlchemy 1215, 'Cannot add f oreign key constraint'
Flask_SqlAlchemy 1215, 'Cannot add f oreign key constraint'报错 sqlalchemy.exc.IntegrityError: (pymysq ...
- bzoj1038: [ZJOI2008]瞭望塔
Description 致力于建设全国示范和谐小村庄的H村村长dadzhi,决定在村中建立一个瞭望塔,以此加强村中的治安.我们将H村抽象为一维的轮廓.如下图所示 我们可以用一条山的上方轮廓折线(x1, ...
- 转:FIFO和DMA
FIFO SPI端口增加了FIFO,使得传输数据有了缓冲区间. FIFO存储器是一个先入先出的双口缓冲器,即第一个进入其内的数据第一个被移出,其中一个存储器的输入口,另一个口是存储器的输出口.主要有三 ...
- WPF会重写Windows GUI的历史吗?
原文地址:http://tech.it168.com/zx/2007-09-15/200709141320653.shtml 你可能对微软的.NET框架3.0版本的最近的一次更新感到有点奇怪.主版本指 ...
- LINUX-LXC要好好关注下
因为我觉得轻量极虚拟化可能是云的另一个发展方向. 至少,腾讯的WEB云引擎是以此为基础. LXC结合DOCKER.相信是快速云的另一种实现. 余下的,只是结合生产系统围绕这一中心进行的的二次开了. I ...
- For循环复杂练习
for是循环当中经常用到的一个结构,练熟了才可以. 练习-需求描述: 在控制台打印以下形式的字符: * * * * * * * * * * * * * * * 思路,首先分析需求的规律 1.首先分析需 ...
- 「Poetize3」导弹防御塔
描述 Description Freda控制着N座可以发射导弹的防御塔.每座塔都有足够数量的导弹,但是每座塔每次只能发射一枚.在发射导弹时,导弹需要T1秒才能从防御塔中射出,而在发射导弹后,发射这枚导 ...
- C语言基础课程 第三课 ADB(Android Debug Bridge)的使用
由于前面已经发布过Linux的博客了 基础班将Linux基础命令就不单独发表博客了,本节课主要就是利用adb连接手机进行一个Linux基本命令的复习.而且熟悉手机的底层运作,不用界面操作照样也能 ...
- page-object使用(1)
创建你的page 你必须做的第一件事情是创建你的page,这是一些包含了PageObject模块的简单的ruby类,请不要创建你自己的initialize方法,因为已经有一个存在而且不能被覆盖.如果你 ...