免费注册 查看新帖 |

Chinaunix

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

[FTP] 为什么vsftpd改成xinetd后登录慢30秒左右 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-03-01 15:27 |只看该作者 |倒序浏览
如题,安装最新的vsftpd tar包2.1.0后,standalone运行登录5秒内就登录成功,如果改成xinetd后就变成30秒左右。有什么办法吗,日志没什么有用的信息。下面是我的vsftpd.conf,麻烦帮忙看看。


  1. [root@www ~]# cat /etc/vsftpd.conf
  2. # Example config file /etc/vsftpd.conf
  3. #
  4. # The default compiled in settings are fairly paranoid. This sample file
  5. # loosens things up a bit, to make the ftp daemon more usable.
  6. # Please see vsftpd.conf.5 for all compiled in defaults.
  7. #
  8. # READ THIS: This example file is NOT an exhaustive list of vsftpd options.
  9. # Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
  10. # capabilities.
  11. #
  12. # Allow anonymous FTP? (Beware - allowed by default if you comment this out).
  13. #anonymous_enable=YES
  14. anonymous_enable=NO
  15. #
  16. # Uncomment this to allow local users to log in.
  17. #local_enable=YES
  18. local_enable=NO
  19. #
  20. # Uncomment this to enable any form of FTP write command.
  21. #write_enable=YES
  22. write_enable=YES
  23. #
  24. # Default umask for local users is 077. You may wish to change this to 022,
  25. # if your users expect that (022 is used by most other ftpd's)
  26. #local_umask=022
  27. local_umask=022
  28. #
  29. # Uncomment this to allow the anonymous FTP user to upload files. This only
  30. # has an effect if the above global write enable is activated. Also, you will
  31. # obviously need to create a directory writable by the FTP user.
  32. #anon_upload_enable=YES
  33. #
  34. # Uncomment this if you want the anonymous FTP user to be able to create
  35. # new directories.
  36. #anon_mkdir_write_enable=YES
  37. #
  38. # Activate directory messages - messages given to remote users when they
  39. # go into a certain directory.
  40. dirmessage_enable=YES
  41. #
  42. # Activate logging of uploads/downloads.
  43. xferlog_enable=YES
  44. #
  45. # Make sure PORT transfer connections originate from port 20 (ftp-data).
  46. connect_from_port_20=YES
  47. #
  48. # If you want, you can arrange for uploaded anonymous files to be owned by
  49. # a different user. Note! Using "root" for uploaded files is not
  50. # recommended!
  51. #chown_uploads=YES
  52. #chown_username=whoever
  53. #
  54. # You may override where the log file goes if you like. The default is shown
  55. # below.
  56. #xferlog_file=/var/log/vsftpd.log
  57. xferlog_file=/var/log/vsftpd.log
  58. #
  59. # If you want, you can have your log file in standard ftpd xferlog format.
  60. # Note that the default log file location is /var/log/xferlog in this case.
  61. #xferlog_std_format=YES
  62. xferlog_std_format=YES
  63. #
  64. # You may change the default value for timing out an idle session.
  65. #idle_session_timeout=600
  66. idle_session_timeout=600
  67. #
  68. # You may change the default value for timing out a data connection.
  69. #data_connection_timeout=120
  70. data_connection_timeout=12000
  71. #
  72. # It is recommended that you define on your system a unique user which the
  73. # ftp server can use as a totally isolated and unprivileged user.
  74. #nopriv_user=ftpsecure
  75. #
  76. # Enable this and the server will recognise asynchronous ABOR requests. Not
  77. # recommended for security (the code is non-trivial). Not enabling it,
  78. # however, may confuse older FTP clients.
  79. #async_abor_enable=YES
  80. #
  81. # By default the server will pretend to allow ASCII mode but in fact ignore
  82. # the request. Turn on the below options to have the server actually do ASCII
  83. # mangling on files when in ASCII mode.
  84. # Beware that on some FTP servers, ASCII support allows a denial of service
  85. # attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd
  86. # predicted this attack and has always been safe, reporting the size of the
  87. # raw file.
  88. # ASCII mangling is a horrible feature of the protocol.
  89. #ascii_upload_enable=YES
  90. #ascii_download_enable=YES
  91. #
  92. # You may fully customise the login banner string:
  93. #ftpd_banner=Welcome to blah FTP service.
  94. ftpd_banner=Welcome to  FTP service.
  95. #
  96. # You may specify a file of disallowed anonymous e-mail addresses. Apparently
  97. # useful for combatting certain DoS attacks.
  98. #deny_email_enable=YES
  99. # (default follows)
  100. #banned_email_file=/etc/vsftpd.banned_emails
  101. #
  102. # You may specify an explicit list of local users to chroot() to their home
  103. # directory. If chroot_local_user is YES, then this list becomes a list of
  104. # users to NOT chroot().
  105. #chroot_list_enable=YES
  106. # (default follows)
  107. #chroot_list_file=/etc/vsftpd.chroot_list
  108. #
  109. # You may activate the "-R" option to the builtin ls. This is disabled by
  110. # default to avoid remote users being able to cause excessive I/O on large
  111. # sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
  112. # the presence of the "-R" option, so there is a strong case for enabling it.
  113. #ls_recurse_enable=YES
  114. #
  115. # When "listen" directive is enabled, vsftpd runs in standalone mode and
  116. # listens on IPv4 sockets. This directive cannot be used in conjunction
  117. # with the listen_ipv6 directive.
  118. #listen=YES
  119. listen=NO

  120. #
  121. # This directive enables listening on IPv6 sockets. To listen on IPv4 and IPv6
  122. # sockets, you must run two copies of vsftpd whith two configuration files.
  123. # Make sure, that one of the listen options is commented !!
  124. #listen_ipv6=YES

  125. chroot_local_user=YES
  126. pam_service_name=ftp
  127. user_config_dir=/etc/vsftpd_user_conf/local_user_config
  128. max_clients=5
  129. max_per_ip=5
  130. [root@www ~]#
复制代码


xinetd下面的

  1. [root@www ~]# cat /etc/xinetd.d/vsftpd
  2. # default: on
  3. # description:
  4. #   The vsftpd FTP server serves FTP connections. It uses
  5. #   normal, unencrypted usernames and passwords for authentication.
  6. # vsftpd is designed to be secure.
  7. service ftp
  8. {
  9.         socket_type             = stream
  10.         wait                    = no
  11.         user                    = root
  12.         server                  = /usr/local/sbin/vsftpd
  13. #       server_args             =
  14.         server_args             =/etc/vsftpd.conf
  15. #       log_on_success          += DURATION USERID
  16.        log_on_success          += DURATION USERID
  17. #       log_on_failure          += USERID
  18.         nice                    = 10
  19.         disable                 = no
  20.         port                    = 21
  21. }

  22. [root@www ~]#
复制代码



用CUTEFTP登录时显示卡在下面这个地方。

  1. 状态:>          [2009-3-1 17:06:12] Socket 已连接。正在等候欢迎消息...
  2.                 [2009-3-1 17:06:42] 220 Welcome to FTP service.
  3. 状态:>          [2009-3-1 17:06:42] 已连接。正在验证...
复制代码

[ 本帖最后由 wlacf 于 2009-3-1 17:10 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2009-07-28 21:05 |只看该作者
telnet作为stand alone的话 是经由 /etc/init.d/下的脚本启动的,脚本启动时要读取/etc/sysconfig/下的同名相关文件。
把telnet放在xinetd.conf 或 xinet.d中 除了在server行定义telnet的二进制文件绝对路径名外,是否还应该在 server_args处指定启动参数? 这个参数应该在/etc/sysconfig/下 ,楼主找下,偶没telnet。看named atd 等是这样的。

论坛徽章:
0
3 [报告]
发表于 2009-07-29 09:34 |只看该作者
慢30秒的确有点长了。。。但这个30秒是不是个别现象呢?多测试几台机器看看
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP