免费注册 查看新帖 |

Chinaunix

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

[FTP] 请教:pureftpd+mysql创建虚拟用户无法登陆? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-11-29 17:52 |只看该作者 |倒序浏览
好久没弄linux了,今天在虚拟机上装了centos5.4,再装上pureftpd+mysql+pureftpd_php_manager,但是通过webpureftpd创建的用户无法进行登陆,总提示:530 Login authentication failed。
在网上搜了很多,都没有正确的解决。。。。
我的pure-ftpd.conf文件内容如下:
  1. ChrootEveryone              yes

  2. # If the previous option is set to "no", members of the following group
  3. # won't be caged. Others will be. If you don't want chroot()ing anyone,
  4. # just comment out ChrootEveryone and TrustedGID.

  5. TrustedGID                    100


  6. # Turn on compatibility hacks for broken clients

  7. BrokenClientsCompatibility  no


  8. # Maximum number of simultaneous users

  9. MaxClientsNumber            50


  10. # Fork in background

  11. Daemonize                   yes


  12. # Maximum number of sim clients with the same IP address

  13. MaxClientsPerIP             8

  14. # If you want to log all client commands, set this to "yes".
  15. # This directive can be duplicated to also log server responses.

  16. VerboseLog                  no


  17. # List dot-files even when the client doesn't send "-a".

  18. DisplayDotFiles             yes


  19. # Don't allow authenticated users - have a public anonymous FTP only.

  20. AnonymousOnly               no


  21. # Disallow anonymous connections. Only allow authenticated users.

  22. NoAnonymous                 no


  23. # Syslog facility (auth, authpriv, daemon, ftp, security, user, local*)
  24. # The default facility is "ftp". "none" disables logging.

  25. SyslogFacility              ftp


  26. # Display fortune cookies

  27. # FortunesFile              /usr/share/fortune/zippy


  28. # Don't resolve host names in log files. Logs are less verbose, but
  29. # it uses less bandwidth. Set this to "yes" on very busy servers or
  30. # if you don't have a working DNS.

  31. DontResolve                 yes


  32. # Maximum idle time in minutes (default = 15 minutes)

  33. MaxIdleTime                 15


  34. # LDAP configuration file (see README.LDAP)

  35. # LDAPConfigFile                /etc/pure-ftpd/pureftpd-ldap.conf


  36. # MySQL configuration file (see README.MySQL)

  37. MySQLConfigFile               /etc/pure-ftpd/pureftpd-mysql.conf


  38. # Postgres configuration file (see README.PGSQL)

  39. # PGSQLConfigFile               /etc/pure-ftpd/pureftpd-pgsql.conf

  40. # PureDB user database (see README.Virtual-Users)

  41. # PureDB                        /etc/pure-ftpd/pureftpd.pdb

  42. # Path to pure-authd socket (see README.Authentication-Modules)

  43. # ExtAuth                       /var/run/ftpd.sock


  44. # If you want to enable PAM authentication, uncomment the following line

  45. PAMAuthentication             yes


  46. # If you want simple Unix (/etc/passwd) authentication, uncomment this

  47. # UnixAuthentication            yes


  48. # Please note that LDAPConfigFile, MySQLConfigFile, PAMAuthentication and
  49. # UnixAuthentication can be used only once, but they can be combined
  50. # together. For instance, if you use MySQLConfigFile, then UnixAuthentication,
  51. # the SQL server will be asked. If the SQL authentication fails because the
  52. # user wasn't found, another try # will be done with /etc/passwd and
  53. # /etc/shadow. If the SQL authentication fails because the password was wrong,
  54. # the authentication chain stops here. Authentication methods are chained in
  55. # the order they are given.


  56. # 'ls' recursion limits. The first argument is the maximum number of
  57. # files to be displayed. The second one is the max subdirectories depth

  58. LimitRecursion              7500 8

  59. # Are anonymous users allowed to create new directories ?

  60. AnonymousCanCreateDirs      no


  61. # If the system is more loaded than the following value,
  62. # anonymous users aren't allowed to download.

  63. MaxLoad                     4

  64. # Port range for passive connections replies. - for firewalling.

  65. # PassivePortRange          30000 50000

  66. # Force an IP address in PASV/EPSV/SPSV replies. - for NAT.
  67. # Symbolic host names are also accepted for gateways with dynamic IP
  68. # addresses.

  69. # ForcePassiveIP                192.168.0.1

  70. # Upload/download ratio for anonymous users.

  71. # AnonymousRatio                1 10



  72. # Upload/download ratio for all users.
  73. # This directive superscedes the previous one.

  74. # UserRatio                 1 10


  75. # Disallow downloading of files owned by "ftp", ie.
  76. # files that were uploaded but not validated by a local admin.

  77. AntiWarez                   yes


  78. # IP address/port to listen to (default=all IP and port 21).

  79. Bind                      127.0.0.1,21



  80. # Maximum bandwidth for anonymous users in KB/s

  81. # AnonymousBandwidth            8

  82. # Maximum bandwidth for *all* users (including anonymous) in KB/s
  83. # Use AnonymousBandwidth *or* UserBandwidth, both makes no sense.

  84. # UserBandwidth             8


  85. # File creation mask. <umask for files>:<umask for dirs> .
  86. # 177:077 if you feel paranoid.

  87. Umask                       133:022


  88. # Minimum UID for an authenticated user to log in.

  89. MinUID                      500


  90. # Do not use the /etc/ftpusers file to disable accounts. We're already
  91. # using MinUID to block users with uid < 500

  92. UseFtpUsers no


  93. # Allow FXP transfers for authenticated users.

  94. AllowUserFXP                yes

  95. # Allow anonymous FXP for anonymous and non-anonymous users.

  96. AllowAnonymousFXP           no

  97. # Users can't delete/write files beginning with a dot ('.')
  98. # even if they own them. If TrustedGID is enabled, this group
  99. # will have access to dot-files, though.

  100. ProhibitDotFilesWrite       no


  101. # Prohibit *reading* of files beginning with a dot (.history, .ssh...)

  102. ProhibitDotFilesRead        no

  103. # Never overwrite files. When a file whoose name already exist is uploaded,
  104. # it get automatically renamed to file.1, file.2, file.3, ...

  105. AutoRename                  no


  106. # Disallow anonymous users to upload new files (no = upload is allowed)

  107. AnonymousCantUpload         yes

  108. # Only connections to this specific IP address are allowed to be
  109. # non-anonymous. You can use this directive to open several public IPs for
  110. # anonymous FTP, and keep a private firewalled IP for remote administration.
  111. # You can also only allow a non-routable local IP (like 10.x.x.x) to
  112. # authenticate, and keep a public anon-only FTP server on another IP.

  113. #TrustedIP                  10.1.1.1


  114. # If you want to add the PID to every logged line, uncomment the following
  115. # line.

  116. #LogPID                     yes


  117. # Create an additional log file with transfers logged in a Apache-like format :
  118. # fw.c9x.org - jedi [13/Dec/1975:19:36:39] "GET /ftp/linux.tar.bz2" 200 21809338
  119. # This log file can then be processed by www traffic analyzers.

  120. AltLog                     clf:/var/log/pureftpd.log


  121. # Create an additional log file with transfers logged in a format optimized
  122. # for statistic reports.

  123. # AltLog                     stats:/var/log/pureftpd.log


  124. # Create an additional log file with transfers logged in the standard W3C
  125. # format (compatible with most commercial log analyzers)

  126. # AltLog                     w3c:/var/log/pureftpd.log


  127. # Disallow the CHMOD command. Users can't change perms of their files.

  128. #NoChmod                     yes


  129. # Allow users to resume and upload files, but *NOT* to delete them.

  130. KeepAllFiles                yes


  131. # Automatically create home directories if they are missing

  132. CreateHomeDir               yes

  133. # Enable virtual quotas. The first number is the max number of files.
  134. # The second number is the max size of megabytes.
  135. # So 1000:10 limits every user to 1000 files and 10 Mb.

  136. #Quota                       1000:10


  137. # If your pure-ftpd has been compiled with standalone support, you can change
  138. # the location of the pid file. The default is /var/run/pure-ftpd.pid

  139. PIDFile                     /var/run/pure-ftpd.pid

  140. # If your pure-ftpd has been compiled with pure-uploadscript support,
  141. # this will make pure-ftpd write info about new uploads to
  142. # /var/run/pure-ftpd.upload.pipe so pure-uploadscript can read it and
  143. # spawn a script to handle the upload.

  144. #CallUploadScript yes

  145. # This option is useful with servers where anonymous upload is
  146. # allowed. As /var/ftp is in /var, it save some space and protect
  147. # the log files. When the partition is more that X percent full,
  148. # new uploads are disallowed.

  149. MaxDiskUsage               99


  150. # Set to 'yes' if you don't want your users to rename files.

  151. #NoRename                  yes



  152. # Be 'customer proof' : workaround against common customer mistakes like
  153. # 'chmod 0 public_html', that are valid, but that could cause ignorant
  154. # customers to lock their files, and then keep your technical support busy
  155. # with silly issues. If you're sure all your users have some basic Unix
  156. # knowledge, this feature is useless. If you're a hosting service, enable it.

  157. CustomerProof              yes



  158. # Per-user concurrency limits. It will only work if the FTP server has
  159. # been compiled with --with-peruserlimits (and this is the case on
  160. # most binary distributions) .
  161. # The format is : <max sessions per user>:<max anonymous sessions>
  162. # For instance, 3:20 means that the same authenticated user can have 3 active
  163. # sessions max. And there are 20 anonymous sessions max.

  164. # PerUserLimits            3:20



  165. # When a file is uploaded and there is already a previous version of the file
  166. # with the same name, the old file will neither get removed nor truncated.
  167. # Upload will take place in a temporary file and once the upload is complete,
  168. # the switch to the new version will be atomic. For instance, when a large PHP
  169. # script is being uploaded, the web server will still serve the old version and
  170. # immediatly switch to the new one as soon as the full file will have been
  171. # transfered. This option is incompatible with virtual quotas.

  172. # NoTruncate               yes



  173. # This option can accept three values :
  174. # 0 : disable SSL/TLS encryption layer (default).
  175. # 1 : accept both traditional and encrypted sessions.
  176. # 2 : refuse connections that don't use SSL/TLS security mechanisms,
  177. #     including anonymous sessions.
  178. # Do _not_ uncomment this blindly. Be sure that :
  179. # 1) Your server has been compiled with SSL/TLS support (--with-tls),
  180. # 2) A valid certificate is in place,
  181. # 3) Only compatible clients will log in.

  182. # TLS                      1



  183. # Listen only to IPv4 addresses in standalone mode (ie. disable IPv6)
  184. # By default, both IPv4 and IPv6 are enabled.

  185. # IPV4Only                 yes



  186. # Listen only to IPv6 addresses in standalone mode (ie. disable IPv4)
  187. # By default, both IPv4 and IPv6 are enabled.

  188. # IPV6Only                 yes

  189. # UTF-8 support for file names (RFC 2640)
  190. # Define charset of the server filesystem and optionnally the default charset
  191. # for remote clients if they don't use UTF-8.
  192. # Works only if pure-ftpd has been compiled with --with-rfc2640

  193. # FileSystemCharset        big5
  194. # ClientCharset                big5
复制代码


查看系统日志:
  1. Nov 29 17:33:02 CentOS pure-ftpd: (?@192.168.80.198) [INFO] Logout.
  2. Nov 29 17:33:02 CentOS pure-ftpd: (?@192.168.80.198) [INFO] New connection from 192.168.80.198
  3. Nov 29 17:33:03 CentOS pure-ftpd: (?@192.168.80.198) [ERROR] The SQL server seems to be down [Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)]
  4. Nov 29 17:33:05 CentOS pure-ftpd: (?@192.168.80.198) [WARNING] Authentication failed for user [a]
  5. Nov 29 17:33:25 CentOS pure-ftpd: (?@192.168.80.198) [INFO] Logout.
  6. Nov 29 17:33:26 CentOS pure-ftpd: (?@192.168.80.198) [INFO] New connection from 192.168.80.198
  7. Nov 29 17:33:27 CentOS pure-ftpd: (?@192.168.80.198) [ERROR] The SQL server seems to be down [Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)]
  8. Nov 29 17:33:29 CentOS pure-ftpd: (?@192.168.80.198) [WARNING] Authentication failed for user [abc]
  9. [root@CentOS ftpdir]#
复制代码



通过phpmyadmin查看到通过pureftpd_php_manager添加的帐号已经进了数据库里去了。
不知道是哪里的问题,还请遇到过的朋友发表一下见解。
---------------------------------------------------------------------------------------------------------------------------------------------------

搞定了,原来是因为通过pureftpd_php_manager添加的FTP帐号没有对密码进行MD5加密所造成的,通过phpmyadmin登陆进去,将相关帐号的密码再执行一次MD5加密,就可以正常登陆了。

但有一点想不明白,pureftpd里面设置的是要对所添加的帐号的密码进行MD5加密,为什么pureftpd_php_manager添加了以后却没有进行加密呢?(截图见附件。为方便测试,其中帐号user,密码也是user,在pureftpd_php_manager添加时,密码显示的为明文,在phpmyadmin后台里面显示的也是明文,就因为没有加密,而帐号在登陆时,系统却以为已经进行过MD5加密过,所以造成登陆不进去的情况。附件中图1前两个用户是我手工在phpmyadmin里将用户密码进行MD5加密的,可以正常登陆;图2为phpmyadmin所显示的,进去时varchar(64)那里什么也没选,“MD5”是我手工选择的。)

不知道哪位朋友解决过这个问题。

[ 本帖最后由 zhxd 于 2009-11-29 22:09 编辑 ]

1.jpg (13.4 KB, 下载次数: 28)

1.jpg

2.jpg (16.61 KB, 下载次数: 24)

2.jpg
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP