请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

【upload.do】504 (剧终,解决办法看下面我的最新一条评论)

系统: ubuntu
catalina.out:

[16:44:10.992][INFO][com.mmall.service.impl.FileServiceImpl][http-bio-8080-exec-8] 开始上传文件,上传文件的文件名:111.png,上传的路径:/developer/apache-tomcat-7.0.73/webapps/ROOT/upload,新文件名:08e4647d-089b-4b86-b10c-9db920bd9399.png
[16:44:10.996][INFO][com.mmall.util.FTPUtil][http-bio-8080-exec-8] 开始连接ftp服务器
[16:46:21.683][ERROR][com.mmall.util.FTPUtil][http-bio-8080-exec-8] 上传文件异常
java.net.ConnectException: Connection timed out
        at java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:1.7.0_80]
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) ~[na:1.7.0_80]
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200) ~[na:1.7.0_80]
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182) ~[na:1.7.0_80]
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:1.7.0_80]
        at java.net.Socket.connect(Socket.java:579) ~[na:1.7.0_80]
        at org.apache.commons.net.ftp.FTPClient._openDataConnection_(FTPClient.java:762) ~[commons-net-3.1.jar:3.1]
        at org.apache.commons.net.ftp.FTPClient._storeFile(FTPClient.java:565) ~[commons-net-3.1.jar:3.1]
        at org.apache.commons.net.ftp.FTPClient.__storeFile(FTPClient.java:557) ~[commons-net-3.1.jar:3.1]
        at org.apache.commons.net.ftp.FTPClient.storeFile(FTPClient.java:1795) ~[commons-net-3.1.jar:3.1]
        at com.mmall.util.FTPUtil.uploadFile(FTPUtil.java:51) [classes/:na]
        at com.mmall.util.FTPUtil.uploadFile(FTPUtil.java:32) [classes/:na]
        at com.mmall.service.impl.FileServiceImpl.upload(FileServiceImpl.java:45) [classes/:na]
        at com.mmall.controller.backend.ProductManageController.upload(ProductManageController.java:130) [classes/:na]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_80]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_80]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_80]
        at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_80]
        at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:214) [spring-web-4.0.0.RELEASE.jar:4.0.0.RELEASE]
        at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132) [spring-web-4.0.0.RELEASE.jar:4.0.0.RELEASE]
        at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) [spring-webmvc-4.0.0.RELEASE.jar:4.0.0.RELEASE]
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:748) [spring-webmvc-4.0.0.RELEASE.jar:4.0.0.RELEASE]
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:689) [spring-webmvc-4.0.0.RELEASE.jar:4.0.0.RELEASE]
        at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83) [spring-webmvc-4.0.0.RELEASE.jar:4.0.0.RELEASE]
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:945) [spring-webmvc-4.0.0.RELEASE.jar:4.0.0.RELEASE]
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:876) [spring-webmvc-4.0.0.RELEASE.jar:4.0.0.RELEASE]
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:931) [spring-webmvc-4.0.0.RELEASE.jar:4.0.0.RELEASE]
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:833) [spring-webmvc-4.0.0.RELEASE.jar:4.0.0.RELEASE]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:650) [servlet-api.jar:na]
        at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:807) [spring-webmvc-4.0.0.RELEASE.jar:4.0.0.RELEASE]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) [servlet-api.jar:na]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) [catalina.jar:7.0.73]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [catalina.jar:7.0.73]
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [tomcat7-websocket.jar:7.0.73]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [catalina.jar:7.0.73]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [catalina.jar:7.0.73]
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) [spring-web-4.0.0.RELEASE.jar:4.0.0.RELEASE]
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108) [spring-web-4.0.0.RELEASE.jar:4.0.0.RELEASE]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [catalina.jar:7.0.73]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [catalina.jar:7.0.73]
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218) [catalina.jar:7.0.73]
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) [catalina.jar:7.0.73]
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505) [catalina.jar:7.0.73]
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169) [catalina.jar:7.0.73]
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) [catalina.jar:7.0.73]
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:958) [catalina.jar:7.0.73]
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) [catalina.jar:7.0.73]
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:452) [catalina.jar:7.0.73]
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1087) [tomcat-coyote.jar:7.0.73]
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637) [tomcat-coyote.jar:7.0.73]
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316) [tomcat-coyote.jar:7.0.73]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_80]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_80]
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-coyote.jar:7.0.73]
        at java.lang.Thread.run(Thread.java:745) [na:1.7.0_80]
java.net.ConnectException: Connection timed out
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
        at java.net.Socket.connect(Socket.java:579)
        at org.apache.commons.net.ftp.FTPClient._openDataConnection_(FTPClient.java:762)
        at org.apache.commons.net.ftp.FTPClient._storeFile(FTPClient.java:565)
        at org.apache.commons.net.ftp.FTPClient.__storeFile(FTPClient.java:557)
        at org.apache.commons.net.ftp.FTPClient.storeFile(FTPClient.java:1795)
        at com.mmall.util.FTPUtil.uploadFile(FTPUtil.java:51)
        at com.mmall.util.FTPUtil.uploadFile(FTPUtil.java:32)
        at com.mmall.service.impl.FileServiceImpl.upload(FileServiceImpl.java:45)
        at com.mmall.controller.backend.ProductManageController.upload(ProductManageController.java:130)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:214)
        at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
        at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:748)
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:689)
        at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:945)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:876)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:931)
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:833)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
        at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:807)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:958)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:452)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1087)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)
[16:46:21.685][INFO][com.mmall.util.FTPUtil][http-bio-8080-exec-8] 开始连接ftp服务器,结束上传,上传结果:{}

vsftpd.log:

Sun Apr 26 16:44:11 2020 [pid 1662] CONNECT: Client "::ffff:182.**.**.**"
Sun Apr 26 16:44:11 2020 [pid 1661] [sammy] OK LOGIN: Client "::ffff:182.**.**.**"

备注:我创建ftp用户文件的方式跟课程中的不一样,是以下面的方式创建的
How To Set Up vsftpd for a User’s Directory on Ubuntu 18.04
并且我用终端ftp命令上传文件没有问题(只是需要进入下一级目录files/ , 默认进入的目录是没有写权限的)

调试:

  1. 我加了一行logger
    图片描述
    日志文件:
    图片描述
    这就说明就是图片中最后一行代码的问题!

我的ftp用户和文件夹是这样创建了:
用户:useadd sammy -d /product/sammy/ftpfile/ -s /usr/sbin
ftpfile: 没有写权限 chmod a-w ftpfile/
files: 在ftpfile/ 下创建子目录 files ,并改变用户(组) chown -R sammy:sammy files/
每次上传文件,登录之后需要进入 files 文件夹才可以进行上传操作

正在回答 回答被采纳积分+3

13回答

提问者 williamdsy 2020-04-27 17:08:51

注意:之前的我发的评论的方法和方向都是错误的,之所以无法上传文件是因为 云服务器和阿里云安全组没有开放 pasv 的 61001/62000 的端口范围


时至今日,耗时两天,终于完美解决了!!

方向是星辰大海~

0 回复 有任何疑惑可以回复我~
提问者 williamdsy 2020-04-27 12:39:20

//img1.sycdn.imooc.com//szimg/5ea661690926c32217000033.jpg

//img1.sycdn.imooc.com//szimg/5ea662d50918469411510147.jpg

upload.do 终于返回了200!!!


//img1.sycdn.imooc.com/szimg/5ea661a80938d26108420588.jpg


我把这些都注释了(事实上只需要注释掉ftpClient.enterLocalPassiveMode();
就可以了),完全模拟了我在终端连接 ftp 的操作!!!

这个问题已经解决

开启新征程!!!!

方向是星辰大海~

0 回复 有任何疑惑可以回复我~
提问者 williamdsy 2020-04-27 07:51:18

//img1.sycdn.imooc.com//szimg/5ea65f4609004eb105970590.jpg

就是在这里,但我找不到问题所在,代码没有错

0 回复 有任何疑惑可以回复我~
提问者 williamdsy 2020-04-27 05:35:08

https://img1.sycdn.imooc.com//szimg/5ea5fde9092a239f08550075.jpg

https://img1.sycdn.imooc.com//szimg/5ea5fe0c09bae56808500177.jpg

https://img1.sycdn.imooc.com//szimg/5ea5fe22092178f106820105.jpg

与我推测一致,但应该怎么改呢?remotePath 我试过了 img 和 /product/sammy/ftpfile/img,但是都没用

0 回复 有任何疑惑可以回复我~
提问者 williamdsy 2020-04-27 01:54:31

我想问题还是想岔了,既然我能够在终端连接 ftp 并成功上传文件,代码也不会有问题,

那问题就是 两者之间的配合问题,我应该修改的是代码里面 连接 ftp 的操作!


但是应该怎么改呢?

明天再来吧,先睡了

0 回复 有任何疑惑可以回复我~
提问者 williamdsy 2020-04-26 23:43:34

Geely 大哥救我!

0 回复 有任何疑惑可以回复我~
提问者 williamdsy 2020-04-26 23:42:02

这就陷入了一个很尴尬的境地了:ftpClient.changeWorkingDirectory(remotePath); 没办法成功,但是不改变目录的话又没有写权限

0 回复 有任何疑惑可以回复我~
提问者 williamdsy 2020-04-26 23:33:19

我知道了 因为 ftpfile/ 是不能有写权限的,所以这行代码就会导致错误了https://img1.sycdn.imooc.com/szimg/5ea5a9a3096bc19804430028.jpg

我可能需要改变这个目录

0 回复 有任何疑惑可以回复我~
提问者 williamdsy 2020-04-26 23:23:40

现在我要:

  1. 按照课程中的方式创建ftp用户和文件夹

  2. 如果第一步还不行,就只能把 vsftpd 配置文件也换成课程中的

  3. 顾虑就是,以前已经试过了课程中的方法,总是无法登录

  4. 看来我得继续研究 vsftpd 的本质

0 回复 有任何疑惑可以回复我~
提问者 williamdsy 2020-04-26 21:31:18

突然看到 配置文件最后一行 

要不取消掉它的注释试试?

不管了,先打王者

0 回复 有任何疑惑可以回复我~
  • 提问者 williamdsy #1
    很遗憾,取消这行注释没有用
    回复 有任何疑惑可以回复我~ 2020-04-26 22:41:07
  • 提问者 williamdsy #2
    难道是因为输入流的问题?
    回复 有任何疑惑可以回复我~ 2020-04-26 22:41:40
  • 提问者 williamdsy #3
    不应该的,因为,我这个代码是从码云上下载的
    所以问题还是出再云服务器上
    回复 有任何疑惑可以回复我~ 2020-04-26 22:43:37
提问者 williamdsy 2020-04-26 21:30:04

vsftpd 的配置文件如下:

# Example config file /etc/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. # # # Run standalone?  vsftpd can run either from an inetd or as a standalone # daemon started from an initscript. listen=NO # # This directive enables listening on IPv6 sockets. By default, listening # on the IPv6 "any" address (::) will accept connections from both IPv6 # and IPv4 clients. It is not necessary to listen on *both* IPv4 and IPv6 # sockets. If you want that (perhaps because you want to listen on specific # addresses) then you must run two copies of vsftpd with two configuration # files. listen_ipv6=YES # # Allow anonymous FTP? (Disabled by default). 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 # # If enabled, vsftpd will display directory listings with the time # in  your  local  time  zone.  The default is to display GMT. The # times returned by the MDTM FTP command are also affected by this # option. use_localtime=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. # Note that the default log file location is /var/log/xferlog in this case. #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 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 #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 restrict local users to their home directories.  See the FAQ for # the possible risks in this before using chroot_local_user or # chroot_list_enable below. chroot_local_user=YES user_sub_token=$USER #local_root=/home/$USER/ftp local_root=/product/$USER/ftpfile # # 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(). # (Warning! chroot'ing can be very dangerous. If using chroot, make sure that # the user does not have write access to the top level directory within the # chroot) #chroot_local_user=YES #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 # # Customization # # Some of vsftpd's settings don't fit the filesystem layout by # default. # # This option should be the name of a directory which is empty.  Also, the # directory should not be writable by the ftp user. This directory is used # as a secure chroot() jail at times vsftpd does not require filesystem # access. secure_chroot_dir=/var/run/vsftpd/empty # # This string is the name of the PAM service vsftpd will use. pam_service_name=vsftpd # # This option specifies the location of the RSA certificate to use for SSL # encrypted connections. rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key ssl_enable=NO pasv_enable=YES pasv_min_port=40000 pasv_max_port=50000 pasv_promiscuous=YES userlist_enable=YES userlist_file=/etc/vsftpd.userlist userlist_deny=NO #reverse_lookup_enable=NO # # Uncomment this to indicate that vsftpd use a utf8 filesystem. #utf8_filesystem=YES

0 回复 有任何疑惑可以回复我~
提问者 williamdsy 2020-04-26 21:24:54

但是为什么会有这个问题呢?

应该就是上面所说的 配置文件和代码中 ftpClient 的设置问题;

那么应该是修改 vsftpd 配置文件还是 代码中的 ftpClient 的属性呢?


0 回复 有任何疑惑可以回复我~
  • 提问者 williamdsy #1
    首先,我要比较一下 vsftpd 配置文件中的额属性 和 ftpClient 的属性,看一下他们有什么联系
    回复 有任何疑惑可以回复我~ 2020-04-26 21:26:26
  • 提问者 williamdsy #2
    害,现在有点精神疲惫
    干这个干得太久了,有点不想干了
    先打一盘王者吧
    如果有大哥知道怎么办,请教我一下哈哈哈
    回复 有任何疑惑可以回复我~ 2020-04-26 21:28:28
提问者 williamdsy 2020-04-26 21:08:41

https://img1.sycdn.imooc.com//szimg/5ea5879609e145af06570433.jpg

应该就是这里出了问题,可能是因为跟我的vsftpd的配置文件冲突了,我调试一下

0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信