您是否也遇到了ECONNREFUSED错误-连接由服务器拒绝在FileZilla中?然后找到本指南真是太好了。我将向您展示三种解决此FTP错误的方法。
第一种方法。更改FileZilla端口的默认值
通过FileZilla连接时,错误的原因可能是端口错误。在这种情况下,您只需要将默认的FTP端口更改为默认的SFTP端口号即可。只需在“ 端口 ” 输入框中将21更改为22。
![](https://habrastorage.org/getpro/habr/post_images/a31/f7d/d0a/a31f7dd0ad0d02450e18eb728fe5be58.png)
第二种方法。禁用防病毒/防火墙
有时,当防病毒软件和/或防火墙拒绝FileZilla建立连接的尝试时,可能会发生此错误。
如果防病毒或防火墙调用ECONNREFUSED,则只需禁用此软件,然后重新连接。首先,我将向您展示如何在macOS上进行操作:
- 单击顶部菜单中的“ Apple ” 图标。转到“ 系统偏好设置 ”。
- “Security & Privacy”.
![](https://habrastorage.org/getpro/habr/post_images/8cb/d64/fd6/8cbd64fd6b53841261ff865ddfd77b5d.png)
- “Firewall” “Turn Off Firewall”.
![](https://habrastorage.org/getpro/habr/post_images/69c/f4c/e35/69cf4ce351d8f39803f843ee9baecdfe.png)
Windows, :
- Windows “Control Panel”.
- “System & Security” “Windows Defender Firewall”.
![](https://habrastorage.org/getpro/habr/post_images/276/63f/854/27663f8540e380cf935f1ec91d71a621.png)
- “Turn Windows Defender Firewall on or off”.
![](https://habrastorage.org/getpro/habr/post_images/f15/f99/34d/f15f9934d50ee1f41afd4801b73300f8.png)
- , Windows “Ok”.
, ().
- «ECONNREFUSED — connection refused by server», .
. FileZilla
, ? , FileZilla:
- FTP- FileZilla, “Edit” “Network Configuration Wizard”.
![](https://habrastorage.org/getpro/habr/post_images/609/f55/c6c/609f55c6ce8cd2258a553a515ea9de07.png)
- “Firewall and router configuration wizard”, “Next”, .
- “Passive (recommended)”. “Allow fallback to another transfer mode on failure”.
![](https://habrastorage.org/getpro/habr/post_images/ecb/cfe/f19/ecbcfef19ce4828913a1d216d8370f1e.png)
- “Use server's external IP address instead”.
- “Get the external IP address from the following URL”. , ( — URL ip.filezilla-project.org/ip.php), “Next”, .
- , “Ask operating system for a port” “Next”.
, . “Test”, FileZilla probe.filezilla-project.org. .
, . . ECONNREFUSED , .
. , «ECONNREFUSED — connection refused by server». , FileZilla. , !