NetBeans-保存时上载失败,但可用于filezilla

时间:2018-10-19 13:56:28

标签: ftp netbeans-8 vsftpd

我创建了一个名为john的新ftp用户,并将我的项目的所有者递归更改为john:ftp-users

我在NetBeans中测试了连接。我得到connection successfull!

但是,如果我尝试上传更改,则会得到以下提示:

227 Entering Passive Mode (192,168,40,44,117,81).
STOR bla.sql.new
553 Could not create file.
DELE bla.sql.new
550 Delete operation failed.

所以我在FileZilla上测试了用户。结果:一切正常。

我还在服务器上的命令行上测试了用户:

ftp localhost
Trying ::1:21 ...
Connected to localhost.
220 Willkommen auf dem Entwicklungsserver
Name (localhost:root): john
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>

如您所见,连接正常。

为什么我不能在NetBeans上上传文件?


该权限设置为744(目录)和644(文件)。


/etc/vsftpd.conf

write_enable=YES
dirmessage_enable=YES
nopriv_user=ftpsecure
ftpd_banner=Willkommen auf dem Entwicklungsserver
ls_recurse_enable=YES
local_enable=YES
anonymous_enable=NO
anon_world_readable_only=YES
syslog_enable=YES
connect_from_port_20=YES
ascii_upload_enable=YES
pam_service_name=vsftpd
listen=YES
#listen_ipv6=YES

ssl_enable=NO
rsa_cert_file=
dsa_cert_file=
#
# Limit passive ports to this range to assis firewalling
pasv_min_port=30000
pasv_max_port=30100

我尝试了this的回答,而this却没有成功。


我查找了错误代码553550

553说,由于不允许使用文件名,因此无法正常工作。因此,我将文件名更改为许多不同的内容,但仍然失败,并出现相同的错误。

550被拒绝权限。


成功上传文件的FileZilla日志文件:

2018-10-19 17:00:30 19616 3 Status: Connect to 192.168.40.44:21 ...
2018-10-19 17:00:30 19616 3 Status: Connection established, wait for welcome message ...
2018-10-19 17:00:30 19616 3 Answer: 220 Welcome to the development server
2018-10-19 17:00:30 19616 3 Command: AUTH TLS
2018-10-19 17:00:30 19616 3 Answer: 530 Please login with USER and PASS.
2018-10-19 17:00:30 19616 3 Command: AUTH SSL
2018-10-19 17:00:30 19616 3 Answer: 530 Please login with USER and PASS.
2018-10-19 17:00:30 19616 3 Status: Unsecure server; he does not support FTP over TLS.
2018-10-19 17:00:30 19616 3 Command: USER john
2018-10-19 17:00:30 19616 3 Answer: 331 Please specify the password.
2018-10-19 17:00:30 19616 3 Command: PASS *******************
2018-10-19 17:00:30 19616 3 Answer: 230 Login successful.
2018-10-19 17:00:30 19616 3 Command: OPTS UTF8 ON
2018-10-19 17:00:30 19616 3 Answer: 200 Always in UTF8 mode.
2018-10-19 17:00:30 19616 3 Status: Registered
2018-10-19 17:00:30 19616 3 Status: Start uploading from C: \ Users \ PC983 \ asdfasdf.txt
2018-10-19 17:00:30 19616 3 Command: CWD / srv / www / htdocs
2018-10-19 17:00:30 19616 3 Answer: 250 Directory successfully changed.
2018-10-19 17:00:30 19616 3 Command: TYPE A
2018-10-19 17:00:30 19616 3 Answer: 200 Switching to ASCII mode.
2018-10-19 17:00:30 19616 3 Command: PASV
2018-10-19 17:00:30 19616 3 Answer: 227 Entering Passive Mode (192,168,40,44,117,80).
2018-10-19 17:00:30 19616 3 Command: STOR asdfasdf.txt
2018-10-19 17:00:30 19616 3 Answer: 150 Ok to send data.
2018-10-19 17:00:30 19616 3 Answer: 226 Transfer complete.
2018-10-19 17:00:30 19616 3 Status: file transfer successful, transfer 5 bytes in 1 second
2018-10-19 17:00:30 19616 3 Status: Receive directory content for "/ srv / www / htdocs" ...
2018-10-19 17:00:30 19616 3 Command: TYPE I
2018-10-19 17:00:30 19616 3 Answer: 200 Switching to Binary mode.
2018-10-19 17:00:30 19616 3 Command: PASV
2018-10-19 17:00:30 19616 3 Answer: 227 Entering Passive Mode (192,168,40,44,117,86).
2018-10-19 17:00:30 19616 3 Command: LIST
2018-10-19 17:00:30 19616 3 Answer: 150 Here comes the directory listing.
2018-10-19 17:00:30 19616 3 Answer: 226 Directory send OK.
2018-10-19 17:00:30 19616 3 Status: Completed displaying the directory contents for "/ srv / www / htdocs"

被动模式已打开。

3 个答案:

答案 0 :(得分:0)

在Windows中,关闭防火墙并保存,然后再次打开并保存。这帮了我大忙。之后,我可以上传文件了。 我有以下ftp设置:-

被动模式-开启
加密-纯FTP
端口-21
忽略断开连接错误-关闭

答案 1 :(得分:0)

在远程连接管理对话框中选中“仅加密身份验证过程”-为我解决了这个问题!

答案 2 :(得分:-1)

我可以通过将上载目录更改为ftp用户的主目录来解决此问题。

将上载目录设置为/srv/www/htdocs可以解决该问题,即使ftpuser的主目录已经设置为/srv/www/htdocs

如果我通过FileZilla登录,那么我总是从/srv/www/htdocs开始,但是我也能够导航到根目录。

我不知道为什么要这么做。