免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 15411 | 回复: 3
打印 上一主题 下一主题

[FTP] 500 OOPS: could not open chroot() list file:/etc/vsftpd.chroot_list [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-08-03 20:14 |只看该作者 |倒序浏览
调试了一天 vsftp 总是出问题,怪了!
大家帮忙看一下,vsftpd.conf

# Example config file /etc/vsftpd/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=NO
#
# Uncomment this to allow local users to log in.
local_enable=YES
#
# Uncomment this to enable any form of FTP write command.
write_enable=YES
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
local_umask=022
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
#anon_upload_enable=YES
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#anon_mkdir_write_enable=YES
#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES
#
# Activate logging of uploads/downloads.
xferlog_enable=YES
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
#
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using "root" for uploaded files is not
# recommended!
#chown_uploads=YES
#chown_username=whoever
#
# You may override where the log file goes if you like. The default is shown
# below.
#xferlog_file=/var/log/vsftpd.log
#
# If you want, you can have your log file in standard ftpd xferlog format
xferlog_std_format=YES
#
# You may change the default value for timing out an idle session.
#idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
#data_connection_timeout=120
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
#nopriv_user=ftpsecure
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that turning on ascii_download_enable enables malicious remote parties
# to consume your I/O resources, by issuing the command "SIZE /big/file" in
# ASCII mode.
# These ASCII options are split into upload and download because you may wish
# to enable ASCII uploads (to prevent uploaded scripts etc. from breaking),
# without the DoS risk of SIZE and ASCII downloads. ASCII mangling should be
# on the client anyway..
#ascii_upload_enable=YES
#ascii_download_enable=YES
#
# You may fully customise the login banner string:
#ftpd_banner=Welcome to blah FTP service.
#
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# useful for combatting certain DoS attacks.
#deny_email_enable=YES
# (default follows)
#banned_email_file=/etc/vsftpd.banned_emails
#

# 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_list_enable=YES

# (default follows)
chroot_list_file=/etc/vsftpd.chroot_list

#
# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# the presence of the "-R" option, so there is a strong case for enabling it.
#ls_recurse_enable=YES

pam_service_name=vsftpd
userlist_enable=YES
#enable for standalone mode
listen=YES
tcp_wrappers=YES

#passwd_chroot_enable=YES


chroot_list_enable=YES --- 改为 yes  500 OOPS: could not open chroot() list file:/etc/vsftpd.chroot_list ,改为 NO ,没问题!可是又不能限制主目录。

etc/vsftpd.chroot_list  也加上了用户。
还有一个问题,好像不能上传。


我是按下面的方法做的,谁可以帮我看看,谢谢了
****************

通过vsftp限定用户访问目录

1. 安装vsftpd

2. Vi /etc/vsftpd/vsftpd.conf

修改如下:

#匿名用户

anonymous_enable=NO

#anon_mkdir_write_enable=YES

#anon_upload_enable=YES

#本地用户能否登陆

#local_enable=YES

#是否可写

write_enable=YES

#VSFTPD独立运行 (用vsftpd /etc/vsftpd.conf &amp以及下载速度的限制

listen=YES

max_clients=600

max_per_ip=5

tcp_wrappers=YES

connect_from_port_20=YES

#anon_max_rate=51200 (56k)

#local_max_rate=512000 (560k)

#如何更改路径

#anon_root=/var/ftp/pub

#local_root=/var/ftp

#如何随意增加一个用户目录

通过useradd -d /path/dir -M name 以及chmod ? /path/dir 可以达到

#如何对磁盘限额

用quota对/etc/fstab进行限制,然后对特定用户进行限制

如何把用户限制在家目录中呢?
先建立vsftpd组和用户brian
groupadd vsftpd
Useradd -d /brian -g vsftpd brian
  我们要自己建一个文件,在/etc目录中
  #touch /etc/vsftpd.chroot_list

  以brian这个用户为例

  在vsftpd.chroot_list这个文件中,把brian添上去就行。

  然后改/etc/vsftpd/vsftpd.conf文件,找如下的两行

  把前面的#号去掉,也就是这样的

  chroot_list_enable=YES

  chroot_list_file=/etc/vsftpd.chroot_list

  如果没有这样的两行,就可以自己添加上去也是一样的。

  设置好后,重新vsFTPD服务器。

打开vsFTP服务器的日志功能:

  把下面xferlog_file前面的#号对掉,也就是把vsftp的log功能打开,这样我们就能在/var/log目录下查看vsftpd.log。这是vsFTP的日志功能,这对于我们来说是极为重要的。

  #xferlog_file=/var/log/vsftpd.log

  补充三:如何让绑定IP到vsFTP?也就是说,如何让用户只能通过某个IP来访问FTP。其实这个功能很有意思。如果绑定的是内网的IP,外部是没有办法访问的。如果绑定的是对外服务的IP,内网也只能通过对外服务的IP来访问FTP

  在/etc/vsftpd/vsftpd.conf中加一行,以我的局域网为例,请看第一帖中的操作环境,这样外网就不能访问我的FTP了,内网也可能通过192.168.0.2来访问FTP

listen_address=192.168.0.2

  加完后,要重启vsFTP服务器

3. 限制用户只能用ftp上传、下载文件,而不能登陆

Vi /etc/passwd

brian:515:515::/brian:/sbin/nologin

现在试试看,只能用brian做上传\下载文件,而不能登陆服务器了.

root@linuxsir001 root]# /etc/init.d/vsftpd restart
关闭 vsftpd:[ 确定 ]
为 vsftpd 启动 vsftpd:[ 确定 ]

论坛徽章:
0
2 [报告]
发表于 2008-08-05 09:27 |只看该作者
是不是贴子太长了,没人管呀?

论坛徽章:
0
3 [报告]
发表于 2008-08-06 17:45 |只看该作者
加个
chroot_local_user=YES

论坛徽章:
0
4 [报告]
发表于 2012-05-23 09:42 |只看该作者
我也是这个问题 纠结了两天了
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP