NetBeans - 保存时上传失败,但它适用于 filezilla
NetBeans - Upload on save fails, but it works with filezilla
我创建了一个名为 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 answer and this 没有成功。
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"
被动模式已开启。
我通过将上传目录更改为 ftp 用户的主目录来解决这个问题。
将上传目录设置为 /srv/www/htdocs
解决了这个问题,即使 ftp 用户的主目录已经设置为 /srv/www/htdocs
。
如果我通过 FileZilla 登录,那么我总是从 /srv/www/htdocs
开始,但我也能够导航到根目录。
我不知道为什么我必须这样做。
在windows中,关闭防火墙并保存,再次打开并保存。这对我有用。之后我就可以上传文件了。
我有以下 ftp 设置:-
被动模式 - 开启
加密 - 纯 FTP
端口 - 21
忽略断开连接错误 - 关闭
在远程连接管理对话框中选中“仅加密身份验证过程”- 解决了我的问题!
我创建了一个名为 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 answer and this 没有成功。
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"
被动模式已开启。
我通过将上传目录更改为 ftp 用户的主目录来解决这个问题。
将上传目录设置为 /srv/www/htdocs
解决了这个问题,即使 ftp 用户的主目录已经设置为 /srv/www/htdocs
。
如果我通过 FileZilla 登录,那么我总是从 /srv/www/htdocs
开始,但我也能够导航到根目录。
我不知道为什么我必须这样做。
在windows中,关闭防火墙并保存,再次打开并保存。这对我有用。之后我就可以上传文件了。 我有以下 ftp 设置:-
被动模式 - 开启
加密 - 纯 FTP
端口 - 21
忽略断开连接错误 - 关闭
在远程连接管理对话框中选中“仅加密身份验证过程”- 解决了我的问题!