`
给一理由先
  • 浏览: 23073 次
  • 性别: Icon_minigender_1
  • 来自: 衡阳
文章分类
社区版块
存档分类
最新评论

Linux用VSftpd搭建FTP服务器-2-主配置文件

阅读更多
上一篇:Linux用VSftpd搭建FTP服务器-1-配置文件位置

vsftpd的主配置文件/etc/vsftpd/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).

#(是否允许匿名登录FTP服务器,默认设置为YES允许,即用户可使用用户名ftp或anonymous进行ftp登录,口令为用户的E-mail地址。如不允许匿名访问去掉前面#并设置为NO)

anonymous_enable=YES

#Uncomment this to allow local users to log in.
#(是否允许本地用户(即linux系统中的用户帐号)登录FTP服务器,默认设置为YES允许,本地用户登录后会进入用户主目录,而匿名用户登录后进入匿名用户的下载目录/var/ftp/pub;若只允许匿名用户访问,前面加上#,可阻止本地用户访问FTP服务器。)
local_enable=YES 

# Uncomment this to enable any form of FTP write command.
#(是否允许本地用户对FTP服务器文件具有写权限,默认设置为YES允许)
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)
# (或其它值,设置本地用户的文件掩码为缺省022,也可根据个人喜好将其设置为其他值,默认值为077)
# 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.
#(是否允许匿名用户上传文件,须将write_enable=YES,默认设置为YES允许)
# anon_upload_enable=YES 

# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
# (是否允许匿名用户创建新文件夹,默认设置为YES允许)
# anon_mkdir_write_enable=YES  

# Activate directory messages - messages given to remote users when they
# go into a certain directory.
# (是否激活目录欢迎信息功能,当用户用CMD     模式首次访问服务器上某个目录时,FTP服务器将显示欢迎信息,默认情况下,欢迎信息是通过该目录下的.message文件获得的,此文件保存自定义的欢迎信息,由用户自己建立)
# dirmessage_enable=YES 

# Activate logging of uploads/downloads.
#(默认值为NO如果启用此选项,系统将会维护记录服务器上传和下载情况的日志文件,默认情况该日志文件为/var/log/vsftpd.log,也可以通过下面的xferlog_file选项对其进行设定。)
xferlog_enable=YES 

# Make sure PORT transfer connections originate from port 20 (ftp-data).
# (设定FTP服务器将启用FTP数据端口的连接请求,ftp-data数据传输,21为连接控制端口)
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!-注意,不推荐使用root用户上传文件
#chown_uploads=YES(设定是否允许改变上传文件的属主,与下面一个设定项配合使用)
#chown_username=whoever (设置想要改变的上传文件的属主,如果需要,则输入一个系统用户名,例如可以把上传的文件都改成root属主。whoever:任何人)

# You may override where the log file goes if you like. The default is shown
# below.
#xferlog_file=/var/log/vsftpd.log(设定系统维护记录FTP服务器上传和下载情况的日志文件,/var/log/vsftpd.log是默认的,也可以另设其它)

# If you want, you can have your log file in standard ftpd xferlog format
# xferlog_std_format=YES(如果启用此选项,传输日志文件将以标准xferlog的格式书写,该格式的日志文件默认为/var/log/xferlog,也可以通过xferlog_file选项对其进行设定,默认值为NO)

# dual_log_enable(如果添加并启用此选项,将生成两个相似的日志文件,默认在/var/log/xferlog和/var/log/vsftpd.log目录下。前者是wu_ftpd类型的传输日志,可以利用标准日志工具对其进行分析;后者是vsftpd类型的日志)

#syslog_enable(如果添加并启用此选项,则原本应该输出到/var/log/vsftpd.log中的日志,将输出到系统日志中)

# You may change the default value for timing out an idle session.
# idle_session_timeout=600 (设置数据传输中断间隔时间,此语句表示空闲的用户会话中断时间为600秒,即当数据传输结束后,用户连接FTP服务器的时间不应超过600秒,可以根据实际情况对该值进行修改)

# You may change the default value for timing out a data connection.
# data_connection_timeout=120 (设置数据连接超时时间,该语句表示数据连接超时时间为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 (运行vsftpd需要的非特权系统用户,缺省是nobody)

# 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(如果FTP client会下达“async ABOR”这个指令时,这个设定才需要启用,而一般此设定并不安全,所以通常将其取消)

# 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 on some FTP servers, ASCII support allows a denial of service
# attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd
# predicted this attack and has always been safe, reporting the size of the
# raw file.
# ASCII mangling is a horrible feature of the protocol.
# ascii_upload_enable=YES (大多数FTP服务器都选择用ASCII方式传输数据,将#去掉就能实现用ASCII方式上传和下载文件)

# You may fully customise the login banner string:
# ftpd_banner=Welcome to blah FTP service. (将#去掉可设置登录FTP服务器时显示的欢迎信息,可以修改=后的欢迎信息内容。另外如在需要设置更改目录欢迎信息的目录下创建名为.message的文件,并写入欢迎信息保存后,在进入到此目录会显示自定义欢迎信息)

# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# useful for combatting certain DoS attacks.
# (可将某些特殊的email address抵挡住。如果以anonymous登录服务器时,会要求输入密码,也就是您的email address,如果很讨厌某些email address,就可以使用此设定来取消他的登录权限,但必须与下面的设置项配合)
# deny_email_enable=YES
# (default follows)
# (当上面的deny_email_enable=YES时,可以利用这个设定项来规定那个email address不可登录vsftpd服务器,此文件需用户自己创建,一行一个email address即可!)
# 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(设置为NO时,用户登录FTP服务器后具有访问自己目录以外的其他文件的权限,设置为YES时,用户被锁定在自己的home目录中,vsftpd将在下面chroot_list_file选项值的位置寻找chroot_list文件,此文件需用户建立,再将需锁定在自己home目录的用户列入其中,每行一个用户)
# (default follows)
# chroot_list_file=/etc/vsftpd/chroot_list(此文件需自己建立,被列入此文件的用户,在登录后将不能切换到自己目录以外的其他目录,由FTP服务器自动地chrooted到用户自己的home目录下,使得chroot_list文件中的用户不能随意转到其他用户的FTP home目录下,从而有利于FTP服务器的安全管理和隐私保护)

# 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(是否允许递归查询,大型站点的FTP服务器启用此项可以方便远程用户查询)

# When "listen" directive is enabled, vsftpd runs in standalone mode and
# listens on IPv4 sockets. This directive cannot be used in conjunction
# with the listen_ipv6 directive.
listen=YES(如果设置为YES,则vsftpd将以独立模式运行,由vsftpd自己监听和处理连接请求)

# This directive enables listening on IPv6 sockets. To listen on IPv4 and IPv6
# sockets, you must run two copies of vsftpd whith two configuration files.
# Make sure, that one of the listen options is commented !!
# listen_ipv6=YES(设定是否支持IPV6)
# pam_service_name=vsftpd(设置PAM外挂模块提供的认证服务所使用的配置文件名,即/etc/pam.d/vsftpd文件,此文件中file=/etc/vsftpd/ftpusers字段,说明了PAM模块能抵挡的帐号内容来自文件/etc/vsftpd/ftpusers中)
# userlist_enable=YES/NO(此选项默认值为NO ,此时ftpusers文件中的用户禁止登录FTP服务器;若此项设为YES,则user_list文件中的用户允许登录   FTP服务器,而如果同时设置了userlist_deny=YES,则user_list文件中的用户将不允许登录FTP服务器,甚至连输入密码提示信息都没有,直接被FTP服务器拒绝)
# userlist_deny=YES/NO(此项默认为YES,设置是否阻扯user_list文件中的用户登录FTP服务器)
tcp_wrappers=YES 
#(表明服务器使用tcp_wrappers作为主机访问控制方式,tcp_wrappers可以实现linux系统中网络服务的基于主机地址的访问控制,在/etc目录中的hosts.allow和hosts.deny两个文件用于设置tcp_wrappers的访问控制,前者设置允许访问记录,后者设置拒绝访问记录。例如想限制某些主机对FTP服务器192.168.57.2的匿名访问,编缉/etc/hosts.allow文件,如在下面增加两行命令:vsftpd:192.168.57.1ENY 和vsftpd:192.168.57.9ENY表明限制IP为192.168.57.1/192.168.57.9主机访问IP为192.168.57.2的FTP服务器,此时FTP服务器虽可以PING通,但无法连接)


分享到:
评论

相关推荐

    Linux中搭建FTP服务器的方法

    Linux是以后操作系统的趋势所在,目前的大部分国产操作系统,甚至于安卓系统都是与Linux离不开关系。其中,FTP作为其中共享...今天来说一下在RHEL5下使用VSftpd来搭建ftp服务器,在搭建之前首先要考虑自己的工作环境

    基于stupid-ftpd的海思3531D 嵌入式linux搭建ftp服务器.pdf

    基于海思hi3531D的嵌入式ftp服务器的搭建,使用stupid-ftpd的工具,具有配置项简单,比vsftpd控制简单、直观,windows是使用FileZilla进行文件的上传和下载。

    linux vsftpd搭建步骤 亲测可用

    一 vsftpd搭建步骤 1、首先安装vsftpd,并设置开机启动 yum -y install vsftpd chkconfig vsftpd on 2、基于虚拟用户配置,(所谓虚拟用户就是没有使用真实的帐户,只是通过映射到真实帐户和设置权限的目的。虚拟...

    Linux FTP服务搭建

    pam_service_name=vsftpd.pam PAM配置文件名,这里是vsftpd.pam user_sub_token=$USER local_root=/var/ftp/virtual/$USER 指定每个虚拟用户账号配置目录 local_root=/var/ftp 指定默认的ftp目录 xferlog_enable=YES...

    Linux搭建FTP服务器

     本章主要介绍在Linux中搭建FTP服务器的过程,需要掌握的要点是配置文件的合理配置。  知识点  在linux中使用的FTP是vsftp  FTP可以有三种登入方式分别是:  匿名登录方式:不需要用户密码  本地用户...

    Linux系统搭建ftp服务器

    Linux系统搭建ftp服务器 检测Linux系统是否安装vsftp: 命令: rpm -qa | grep vsftpd 空白表示未安装,继续安装; 命令: yum -y install vsftpd 启动ftp服务: 命令: service vsftpd start 再次查看是否安装: 创建...

    Linux下搭建ftp服务器

    注:配置文件路径 /etc/vsftpd/ 创建ftp用户,并付赋权 创建普通用户(我这里用户名为huoher) useradd huoher 设置该用户只能使用ftp而不能通过ssh或其他协议登录进来 usermod -s /sbin/nologin huoher 由于...

    Linux操作系统:FTP服务器简介.pptx

    图2 FTP服务器工作原理(来源:(网络服务器搭建、配置与管理)教材) FTP服务的传输模式 1、主动传输模式 图3主动传输模式(来源:(网络服务器搭建、配置与管理)教材) 图4被动传输模式(来源:(网络服务器搭建...

    Red Hat Linux 9 架设FTP服务器的方法

    vsftpd是目前Linux最好的FTP服务器工具之一,它的最大优点就是安全,除此之外,它还具有体积小,可定制强,效率高的优点。本文介绍了安装vsftpd服务器,启动、重新启动、停止vsftpd服务,对vsftpd配置的方法。

    vsftpd服务器快速配置文件参考.zip

    适用于Linux服务器FTP服务器搭建过程中vsftpd软件的配置文件

    vsftpd配置文件详解 

    ubuntu 下搭建ftp 服务器,配置文件中每一项含义详细解释说明

    Linux下使用vsftp搭建FTP服务器(附参数说明)

    本章主要介绍在Linux中搭建FTP服务器的过程,需要掌握的要点是配置文件的合理配置。 知识点 在linux中使用的FTP是vsftp FTP可以有三种登入方式分别是: 匿名登录方式:不需要用户密码 本地用户登入:使用本地用户...

    详解在Linux中搭建一个FTP服务器

    在Linux中搭建一个ftp服务器,以供两个工作小组保管文件使用。禁用匿名。第一个小组使用ftp账号:ftp1,工作目录在:/var/ftp/ftp1;第二个小组使用ftp2,工作目录在:/var/ftp/ftp2。 两个小组互相不能访问各自的...

    linux十二章-虚拟用户访问ftp.mp4

    vim /etc/vsftpd/vsftpd.conf (修改主配置文件) userlist_enable=YES //*启用user_list用户列表文件 userlist_deny=NO //*不禁用user_list列表中的用户登录 详 细 实 验 步 骤 结 果 验 证 问 题 及 分 析

    vsftpd在linux的服务器搭建

    vsftpd能正常编译通过,不需要打补丁。 1.make ;make install 2.进入到ftp的根目录默认是/etc/vsftpd/文件中进行配置

    在阿里云ECS服务器上搭建FTP服务

    在阿里云ECS服务器上搭建FTP服务一、简介二、环境简介三、搭建FTP服务器步骤1、配置ECS服务器的安全组策略2、服务器安装vsftpd软件3、修改配置文件4、启动FTP服务5、Windows下登录到FTP服务器 一、简介 FTP是一种...

    linux ftp服务器搭建

    ftp服务器安装设置 第一步: 安装vsftpd 第二步: 配置文件     第三步: 访问服务器进行测试  ============================  后面的内容是对 ftp 服务器进行进一步的安全控制(用户登录控制) ======...

    Ubuntu 安装 vsftpd FTP详细步骤

    用文本编辑器打开 vsftpd.conf 配置文件,一般在 /etc 目录下。 [sudo joe /etc/vsftpd.conf  可以做如下修改: 把 anonymous_enable=YES  改成 anonymous_enable=NO  这将禁止用户匿名访问你

    详解CentOS7 FTP服务搭建(虚拟用户访问FTP服务)

    Liunx外部文件的传输,避免不了使用FTP服务,所以现在就整理下,CentOS7环境下,FTP服务的搭建。FTP服务器需要安装vsftp服务端软件。我们知道,在建立vsftpd用户时,我们一般是在linux下建立用户useradd的方式来访问...

Global site tag (gtag.js) - Google Analytics