vsftpd服务

由vsftpd包提供

不再由xinetd管理

用户认证配置文件:/etc/pam.d/vsftpd

服务脚本: /usr/lib/systemd/system/vsftpd.service

/etc/rc.d/init.d/vsftpd

配置文件:/etc/vsftpd/vsftpd.conf

  1. man 5 vsftpd.conf

格式:option=value

注意:= 前后不要有空格

匿名用户(映射为系统用户ftp )共享文件位置:/var/ftp

系统用户共享文件位置:用户家目录

虚拟用户共享文件位置:为其映射的系统用户的家目录

  1. [root@234c17 ~]# vim /etc/vsftpd/vsftpd.conf
  2.  
  3. # ftp server can use as a totally isolated and unprivileged user.
  4.  
  5. #nopriv_user=ftpsecure
  6.  
  7. #
  8.  
  9. # Enable this and the server will recognise asynchronous ABOR requests. Not
  10.  
  11. # recommended for security (the code is non-trivial). Not enabling it,
  12.  
  13. # however, may confuse older FTP clients.
  14.  
  15. #async_abor_enable=YES
  16.  
  17. #
  18.  
  19. # By default the server will pretend to allow ASCII mode but in fact ignore
  20.  
  21. # the request. Turn on the below options to have the server actually do ASCII
  22.  
  23. # mangling on files when in ASCII mode.
  24.  
  25. # Beware that on some FTP servers, ASCII support allows a denial of service
  26.  
  27. # attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd
  28.  
  29. # predicted this attack and has always been safe, reporting the size of the
  30.  
  31. # recommended!
  32.  
  33. #chown_uploads=YES
  34.  
  35. #chown_username=whoever
  36.  
  37. #
  38.  
  39. # You may override where the log file goes if you like. The default is shown
  40.  
  41. # below.
  42.  
  43. #xferlog_file=/var/log/xferlog
  44.  
  45. #
  46.  
  47. # If you want, you can have your log file in standard ftpd xferlog format.
  48.  
  49. # Note that the default log file location is /var/log/xferlog in this case.
  50.  
  51. xferlog_std_format=YES
  52.  
  53. #
  54.  
  55. # You may change the default value for timing out an idle session.
  56.  
  57. #idle_session_timeout=600
  58.  
  59. #
  60.  
  61. # You may change the default value for timing out a data connection.
  62.  
  63. #data_connection_timeout=120
  64.  
  65. #
  66.  
  67. # It is recommended that you define on your system a unique user which the
  68.  
  69. # ftp server can use as a totally isolated and unprivileged user.
  70.  
  71. #nopriv_user=ftpsecure
  72.  
  73. #
  74.  
  75. # Enable this and the server will recognise asynchronous ABOR requests. Not
  76.  
  77. # recommended for security (the code is non-trivial). Not enabling it,
  78.  
  79. # however, may confuse older FTP clients.
  80.  
  81. #async_abor_enable=YES
  82.  
  83. #
  84.  
  85. # By default the server will pretend to allow ASCII mode but in fact ignore
  86.  
  87. # the request. Turn on the below options to have the server actually do ASCII
  88.  
  89. # mangling on files when in ASCII mode.
  90.  
  91. # Beware that on some FTP servers, ASCII support allows a denial of service
  92.  
  93. # attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd
  94.  
  95. # predicted this attack and has always been safe, reporting the size of the
  96.  
  97. # raw file.
  98.  
  99. # ASCII mangling is a horrible feature of the protocol.
  100.  
  101. #ascii_upload_enable=YES
  102.  
  103. #ascii_download_enable=YES
  104.  
  105. #
  106.  
  107. # You may fully customise the login banner string:
  108.  
  109. #ftpd_banner=Welcome to blah FTP service.
  110.  
  111. #
  112.  
  113. # You may specify a file of disallowed anonymous e-mail addresses. Apparently
  114.  
  115. # useful for combatting certain DoS attacks.
  116.  
  117. #deny_email_enable=YES
  118.  
  119. # (default follows)
  120.  
  121. #banned_email_file=/etc/vsftpd/banned_emails
  122.  
  123. #
  124.  
  125. # You may specify an explicit list of local users to chroot() to their home
  126.  
  127. # directory. If chroot_local_user is YES, then this list becomes a list of
  128.  
  129. # users to NOT chroot().
  130.  
  131. # (Warning! chroot'ing can be very dangerous. If using chroot, make sure that
  132.  
  133. # the user does not have write access to the top level directory within the
  134.  
  135. # chroot)
  136.  
  137. #chroot_local_user=YES
  138.  
  139. #chroot_list_enable=YES
  140.  
  141. # (default follows)
  142.  
  143. #chroot_list_file=/etc/vsftpd/chroot_list
  144.  
  145. #
  146.  
  147. # You may activate the "-R" option to the builtin ls. This is disabled by
  148.  
  149. # default to avoid remote users being able to cause excessive I/O on large
  150.  
  151. # sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
  152.  
  153. # the presence of the "-R" option, so there is a strong case for enabling it.
  154.  
  155. #ls_recurse_enable=YES
  156.  
  157. #
  158.  
  159. # When "listen" directive is enabled, vsftpd runs in standalone mode and
  160.  
  161. # listens on IPv4 sockets. This directive cannot be used in conjunction
  162.  
  163. # with the listen_ipv6 directive.
  164.  
  165. listen=NO
  166.  
  167. #
  168.  
  169. # This directive enables listening on IPv6 sockets. By default, listening
  170.  
  171. # on the IPv6 "any" address (::) will accept connections from both IPv6
  172.  
  173. # and IPv4 clients. It is not necessary to listen on *both* IPv4 and IPv6
  174.  
  175. # sockets. If you want that (perhaps because you want to listen on specific
  176.  
  177. # addresses) then you must run two copies of vsftpd with two configuration
  178.  
  179. # files.
  180.  
  181. # Make sure, that one of the listen options is commented !!
  182.  
  183. listen_ipv6=YES

vsftpd服务配置

命令端口

  1. listen_port=21

主动模式端口

connect_from_port_20=YES 主动模式端口为20

ftp_data_port=20 (默认) 指定主动模式的端口

被动模式端口范围

linux 客户端默认使用被动模式

windows 客户端默认使用主动模式

  1. pasv_min_port=6000 //0为随机分配
  2.  
  3. pasv_max_port=6010

使用当地时间

  1. use_localtime=YES 使用当地时间 //(默认为NO,使用GMT)

匿名用户

  1. anonymous_enable=YES //支持匿名用户
  2.  
  3. no_anon_password=YES(默认NO) //匿名用户略过口令检查
  4.  
  5. anon_world_readable_only //(默认YES)只能下载全部读的文件
  6.  
  7. anon_upload_enable=YES //匿名上传,注意:文件系统权限
  8.  
  9. anon_mkdir_write_enable=YES //匿名建目录
  10.  
  11. anon_umask=077 //指定匿名上传文件的umask
  12.  
  13. anon_other_write_enable=YES //可删除和修改上传的文件
  14. ##指定上传文件的默认的所有者和权限
  15.  
  16. chown_uploads=YES //(默认NO)
  17.  
  18. chown_username=wang
  19.  
  20. chown_upload_mode=0644

Linux系统用户

  1. guest_enable=YES //所有系统用户都映射成guest用户
  2.  
  3. guest_username=ftp //配合上面选项才生效,指定guest用户
  4.  
  5. local_enable=YES //是否允许linux用户登录
  6.  
  7. write_enable-YES //允许linux用户上传文件
  8.  
  9. local_umask=022 //指定系统用户上传文件的默认权限
  10.  
  11. local_root=/ftproot guest//用户登录所在目录

禁锢所有系统用户在家目录中

  1. chroot_local_user=YES //(默认NO,不禁锢)禁锢系统用户

禁锢或不禁锢特定的系统用户在家目录中,与上面设置功能相反

  1. chroot_list_enable=YES
  2.  
  3. chroot_list_file=/etc/vsftpd/chroot_list
  4.  
  5. chroot_local_user=YES时,则chroot_list中用户不禁锢
  6.  
  7. chroot_local_user=NO时,则chroot_list中用户禁锢

wu-ftp日志:默认启用

  1. xferlog_enable=YES //(默认) 启用记录上传下载日志
  2.  
  3. xferlog_std_format=YES //(默认) 使用wu-ftp日志格式
  4.  
  5. xferlog_file=/var/log/xferlog //(默认)可自动生成

vsftpd日志:默认不启用

  1. dual_log_enable=YES //使用vsftpd日志格式,默认不启用
  2.  
  3. vsftpd_log_file=/var/log/vsftpd.log //(默认)可自动生成

登录提示信息

  1. ftpd_banner=“welcome to mage ftp server"
  2.  
  3. banner_file=/etc/vsftpd/ftpbanner.txt //优先上面项生效

目录访问提示信息

  1. dirmessage_enable=YES //(默认)
  2.  
  3. message_file=.message //(默认) 信息存放在指定目录下.message

使用pam(Pluggable Authentication Modules)完成用户认证

pam_service_name=vsftpd

pam配置文件:/etc/pam.d/vsftpd

  1. /etc/vsftpd/ftpusers //默认文件中用户拒绝登录

是否启用控制用户登录的列表文件

  1. userlist_enable=YES //默认有此设置
  2.  
  3. userlist_deny=YES //(默认值) 黑名单,不提示口令,NO为白名单
  4.  
  5. userlist_file=/etc/vsftpd/users_list //此为默认值

vsftpd服务指定用户身份运行

  1. nopriv_user=nobody //(默认值)

连接数限制

  1. max_clients=0 //最大并发连接数
  2.  
  3. max_per_ip=0 //每个IP同时发起的最大连接数

传输速率:字节/秒

  1. anon_max_rate=0 //匿名用户的最大传输速率
  2.  
  3. local_max_rate=0 //本地用户的最大传输速率

连接时间:秒为单位

  1. connect_timeout=60 //主动模式数据连接超时时长
  2.  
  3. accept_timeout=60 //被动模式数据连接超时时长
  4.  
  5. data_connection_timeout=300 //数据连接无数据输超时时长
  6.  
  7. idle_session_timeout=60 //无命令操作超时时长

优先以文本方式传输

  1. ascii_upload_enable=YES
  2.  
  3. ascii_download_enable=YES

配置FTP服务以非独立服务方运行:listen=NO,默认为独立方式

  1. cat /etc/xinetd.d/vsftpd
  2.  
  3. service ftp
  4.  
  5. {
  6.  
  7. flags = REUSE
  8.  
  9. socket_type = stream
  10.  
  11. wait = no
  12.  
  13. user = root
  14.  
  15. server = /usr/sbin/vsftpd
  16.  
  17. log_on_failure += USERID
  18.  
  19. disable = no
  20.  
  21. }

Linux vsftpd服务的更多相关文章

  1. Linux vsftpd服务配置具体解释

    [背景] 近日.一朋友dominoserver要进行升级.迁移,搭建了linux測试系统,也开启vsftpd服务,但是配置的ftp账号,程序无法正常下载附件. [问题跟踪] 通过ftpclient连接 ...

  2. Linux vsftpd服务配置以及三种验证方式以及常见错误解决办法

    文件传输协议(FTP): 文件传输协议(FTP,File Transfer Protocol),即能够让用户在互联网中上传.下载文件的文件协议,而FTP服务器就是支持FTP传输协议的主机,要想完成文件 ...

  3. linux vsftpd 服务配置

    vsftpd.conf配置如下: # Example config file /etc/vsftpd/vsftpd.conf # # The default compiled in settings ...

  4. 《linux就该这么学》第十三节课:第11章和第12章,vsftpd服务与samba和nfs服务

    第十一章 (借鉴请改动) 11.1.文件传输协议 FTP文件穿数协议,端口20用于数据传输,21端口用于传输相关FTP命令 ftp协议的两种工作模式: 主动模式:ftp向客户端发起 被动模式(默认): ...

  5. 打开Linux ftp服务,如:vsftpd: unrecognized service

    打开Linux ftp服务,如:vsftpd: unrecognized service   [root@BZXXDBS02 ~]# service vsftpd start vsftpd: unre ...

  6. 《Linux就该这么学》培训笔记_ch11_使用Vsftpd服务传输文件

    <Linux就该这么学>培训笔记_ch11_使用Vsftpd服务传输文件 文章最后会post上书本的笔记照片. 文章主要内容: 文件传输协议 Vsftpd服务程序 匿名访问模式 本地用户模 ...

  7. Linux环境下安装配置vsftpd服务(三种认证模式)

    一.FTP简介 文件传输协议(英文:File Transfer Protocol,缩写:FTP)是用于在网络上进行文件传输的一套标准协议.它工作于网络传输协议的应用层,使用客户/服务器模式,主要是用来 ...

  8. Linux基础学习-使用vsftpd服务传输文件

    使用vsftpd服务传输文件 1 安装vsftpd [root@qdlinux ~]# yum install vsftpd Loaded plugins: product-id, search-di ...

  9. Linux Vsftpd 连接超时解决方法

    Linux Vsftpd 连接超时解决方法 2013-11-13 10:58:34|  分类: 默认分类|举报|字号 订阅     解决方法(http://www.lingdus.com/thread ...

随机推荐

  1. poj 1186 方程的解数【折半dfs+hash】

    折半搜索,map会T所以用hash表来存状态 #include<iostream> #include<cstdio> #include<map> using nam ...

  2. hbase表结构 + hbase集群架构及表存储机制

    本博文的主要内容有    .hbase读取数据过程 .HBase表结构 .附带PPT http://hbase.apache.org/ 读写的时候,就需要用hbase了,换句话说,就是读写的时候.需要 ...

  3. deque双向队列

    对于双向队列,与队列queue以及vector容器的区别就在于,名字不同,也就是它是双向的,可以从头开始操作,也可以从末尾开始操作. 双向队列的常用方法跟队列queue差不多: 头文件: #inclu ...

  4. (024)[工具软件]截屏录屏软件FSCapture(转)

    该软件比 Snipaste 增加的功能有滚动截图和屏幕录制. 原文地址:https://www.appcgn.com/faststone-capture.html FastStoneCapture,简 ...

  5. RHEL 6.5----Nginx负载均衡

    实验环境 主机名 IP master 192.168.30.130 node-1 192.168.30.131 node-2 192.168.30.132 在master上安装 本次安装过程统一采用Y ...

  6. NFS与AutoNFS实例

    NFS概述: NFS,是Network File System的简写,即网络文件系统.网络文件系统是FreeBSD支持的文件系统中的一种,也被称为NFS. NFS允许一个系统在网络上与他人共享目录和文 ...

  7. 基于CentOS6.5下snort+barnyard2+base的入侵检测系统的搭建(图文详解)(博主推荐)

    为什么,要写这篇论文? 是因为,目前科研的我,正值研三,致力于网络安全.大数据.机器学习研究领域! 论文方向的需要,同时不局限于真实物理环境机器实验室的攻防环境.也不局限于真实物理机器环境实验室的大数 ...

  8. Java提供的序列化和反序列化

    序列化:是指将Java对象转换为二进制数据. 反序列化:将二进制数据转换为Java对象. 与序列化功能相关的类有: java.io.Serializable; java.io.ObjectOutput ...

  9. AJPFX总结I/O流操作(二)

    FileWriter:该类没有特有的方法只有自己的构造函数.该类特点在于1,用于处理文本文件.2,该类中有默认的编码表,3,该类中有临时缓冲.构造函数:在写入流对象初始化时,必须要有一个存储数据的目的 ...

  10. 浏览器报错问题解决:Request header field Content-Type is not allowed by Access-Control-Allow-Headers in preflight respons

    FAQ: Failed to load http://www.erpshop.com/index.php: Request header field Content-Type is not allow ...