500 OOPS: vsftpd: refusing to run with writable root inside chroot()
vsftpd
:
vsftpd
PKG 的更新来源 vsftpd-ssl-2.3.4vsftpd-ssl-3.0.5
。
vsftpd
https://security.appspot.com/vsftpd/Changelog.txt 的官方主页
- Add stronger checks for the configuration error of running with a writeable root directory inside a chroot(). This may bite people who carelessly turned on chroot_local_user but such is life. - Add new config setting "allow_writeable_chroot" to help people in a bit of a spot with the v2.3.5 defensive change. Only applies to non-anonymous.问题是 FTP 用户的根目录是可写的。该
chroot
使用限制,这在最近的更新中是不允许的。该 chroot
用户锁定到的目录不得 写入。chroot
目录:
#chmod a-w /home/user
vsftpd
全局配置文件或单个用户配置文件:allow_writeable_chroot=YES
vsftpd
配置为 /ifs/data/Isilon_Support/
。例如:
# cp -av /etc/mcp/templates/vsftpd.conf /ifs/data/Isilon_Support/vsftpd.conf.bak然后,使用VI编辑器,将以下行添加到
/etc/mcp/templates/vsftpd.conf "
allow_writeable_chroot=YES"
另一种不使用VI编辑器的方法是使用echo命令将一行附加到同一文件:
# echo "allow_writeable_chroot=YES" >> /etc/mcp/templates/vsftpd.conf
等待几秒钟,然后检查文件是否已更新到所有节点,以及文件 md5 校验和是否一致。
# isi_for_array -s md5 /etc/mcp/templates/vsftpd.conf
以下是问题的快速重现和解决步骤:
登录到运行 OneFS 9.4.0.14 的 PowerScale 群集。以下是 FTP 用户主目录:
test2-fxq5rm3-1# ls -ld /ifs/home/warmsvcisiftp
drwx------ 2 warmsvcisiftp Isilon Users 264 Jun 13 02:50 /ifs/home/warmsvcisiftp
FTP 用户登录失败,并显示以下错误消息:
test2-fxq5rm3-1# ftp localhost
Trying 127.0.0.1:21 ...
Connected to localhost.
220-PowerScale OneFS 9.4.0.14
220
Name (localhost:root): warmsvcisiftp
331 Please specify the password.
Password:
500 OOPS: vsftpd: refusing to run with writable root inside chroot()
ftp: Login failed
ftp>
There are two options to address this issue depending on your workflow and concerns:
test2-fxq5rm3-1# chmod a-w /ifs/home/warmsvcisiftp
test2-fxq5rm3-1# ls -ld /ifs/home/warmsvcisiftp
dr-x------ 2 warmsvcisiftp Isilon Users 264 Jun 13 02:50 /ifs/home/warmsvcisiftp
test2-fxq5rm3-1# ftp localhost
Trying 127.0.0.1:21 ...
Connected to localhost.
220-PowerScale OneFS 9.4.0.14
220
Name (localhost:root): warmsvcisiftp
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> bye
221 Goodbye.
test2-fxq5rm3-1# chmod u+w /ifs/home/warmsvcisiftp
test2-fxq5rm3-1# ls -ld /ifs/home/warmsvcisiftp
drwx------ 2 warmsvcisiftp Isilon Users 264 Jun 13 02:50 /ifs/home/warmsvcisiftp
test2-fxq5rm3-1# echo "allow_writeable_chroot=YES" >> /etc/mcp/templates/vsftpd.conf
test2-fxq5rm3-1# isi_for_array -s md5 /etc/mcp/templates/vsftpd.conf
test2-fxq5rm3-1: MD5 (/etc/mcp/templates/vsftpd.conf) = 4920beaff65c3bfa09bd18582c2fbcf8
test2-fxq5rm3-2: MD5 (/etc/mcp/templates/vsftpd.conf) = 4920beaff65c3bfa09bd18582c2fbcf8
test2-fxq5rm3-3: MD5 (/etc/mcp/templates/vsftpd.conf) = 4920beaff65c3bfa09bd18582c2fbcf8
test2-fxq5rm3-1# ftp localhost
Trying 127.0.0.1:21 ...
Connected to localhost.
220-PowerScale OneFS 9.4.0.14
220
Name (localhost:root): warmsvcisiftp
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> bye
221 Goodbye.