我正在尝试通过 ssh、FTP 和 VNC 为我的家用 PC 设置远程访问。SSH 工作正常,是时候使用 FTP 了。我的“服务器”在 Manjaro 下运行,vsftpd 作为 FTP 服务器。首先,我尝试使用 Win10 机器上的 FileZilla 访问它,这里是连接日志:
Status: Connecting to 192.168.50.10:21...
Status: Connection established, waiting for welcome message...
Status: Insecure server, it does not support FTP over TLS.
Status: Logged in
Status: Retrieving directory listing...
Command: PWD
Response: 257 "/home/***" is the current directory
Command: TYPE I
Response: 200 Switching to Binary mode.
Command: PASV
Response: 227 Entering Passive Mode (192,168,50,10,127,51).
Command: LIST
Error: Transfer connection interrupted: ECONNABORTED - Connection aborted
Error: Connection closed by server
Error: Failed to retrieve directory listing
我在路由器中为 FTP 进行了端口转发,并从https://ftptest.net/运行测试,这里是日志:
Warning: Allowing fallback to plaintext FTP is insecure. You should use explicit FTP over TLS.
Status: Resolving address of ***
Status: Connecting to ***
Warning: The entered address does not resolve to an IPv6 address.
Status: Connected, waiting for welcome message...
Reply: 220 (vsFTPd 3.0.3)
Command: CLNT https://ftptest.net on behalf of ***
Reply: 530 Please login with USER and PASS.
Command: AUTH TLS
Reply: 530 Please login with USER and PASS.
Warning: Server refused AUTH TLS, trying deprecated AUTH SSL fallback.
Command: AUTH SSL
Reply: 530 Please login with USER and PASS.
Warning: Server refused AUTH SSL, falling back to insecure plaintext FTP.
Command: USER ***
Reply: 331 Please specify the password.
Command: PASS ******
Reply: 230 Login successful.
Command: SYST
Reply: 215 UNIX Type: L8
Command: FEAT
Reply: 211-Features:
Reply: EPRT
Reply: EPSV
Reply: MDTM
Reply: PASV
Reply: REST STREAM
Reply: SIZE
Reply: TVFS
Reply: UTF8
Reply: 211 End
Warning: The server does not indicate MLSD support. MLSD uses a well-specified listing format. Without MLSD, directory listings have to be obtained using LIST which uses an unspecified output format.
Command: PWD
Reply: 257 "/home/***" is the current directory
Status: Current path is /home/***
Command: TYPE I
Reply: 200 Switching to Binary mode.
Command: PASV
Reply: 227 Entering Passive Mode (*,*,*,*,43,142).
Command: LIST
Status: Data connection established.
Error: Could not read from socket: Connection reset by peer
ftptest.net 说这个错误是由于
- 此问题的常见原因是中断连接的路由器和/或防火墙损坏。
- 一些损坏或配置错误的服务器也可能过早中断连接。
我禁用了win10防火墙,路由器防火墙,我可以进一步检查什么?
更新:
我正在尝试以 Manjaro 的用户身份登录,所以我认为该用户拥有其主目录的所有权限。无论如何,我尝试将权限 777 设置为主目录 - 它没有帮助。我还添加了我的用户vsftpd.userlists
并将这个文件添加到vsftpd.config
- 仍然没有运气。
我sudo systemctl status vsftpd
注意到
vsftpd [14483]:pam_listfile(vsftpd:auth):无法打开/etc/ftpusers
所以我创建了它,并在这里添加了我的用户。现在 FileZilla 说:
响应:530 登录不正确。
,但我确定我的用户和它的密码是正确的,所以我删除了我的用户/etc/ftpusers
,现在我遇到了与以前相同的错误,除了缺少/etc/ftpusers
.
我是网络技术的新手,所以我只是试图在 Mobaxterm 中建立 sftp 会话,但没有成功:
连接错误:无法连接到服务器
更新 2:
我仍然无法设置 FTP,但 SFTP 运行良好,所以我接受了答案。
如果可以运行
ssh
,则sftp
可用。它就像 FTP,但具有 ssh 的内置安全性。界面看起来一样。