Can't connect to server using Filezilla.

January 31, 2019 3k views
Getting Started

My configuration for Filezilla are:

Protocol: SFTP
Host: my ip address
Port: 22
Logon type: Key file
User: root

I try to connect to server and receive this error:

Status: Connecting to <my ip address>...
Response: fzSftp started, protocol_version=8
Command: keyfile <my ppk file>
Command: open "root@<my ip address>" 22
Error: Connection timed out after 20 seconds of inactivity
Error: Could not connect to server

2 Answers

Hello there!

Based on the provided information, it is my opinion that one or more of these is true:

  1. The server's networking is down.
  2. The SSH service is listening on a different port (not 22).
  3. The server's firewall has the SSH port blocked for inbound traffic.
  4. The client computer has SSH port blocked for outbound traffic.
  5. Something like fail2ban on the server blocked your IP for a period of time after a few failed logins.

I can't say for sure which or which combination, but the timeout provides a clear indication that it is not directly based on login at that stage (though #5 would imply that it was in previous errors). Let's break those possibilities down a bit.

+1. Ping the droplet, see if you get a response. While firewall can block ping too, I doubt you've done anything to block ICMP packets. It's just not common behavior. https://www.wikihow.com/Ping-an-IP-Address

If this fails, refer to https://www.digitalocean.com/community/questions/having-trouble-with-the-network-on-your-droplet

+2. Log in via web console and run this:

netstat -tulpn

Do you see SSH? Is it on port 22? If not, try using the other port. If it is, move on. If it's on another port and still fails the same, move on as well.

+3. Open the port. Let's assume 22 from this point forward, though use your findings in #2 to inform otherwise.

iptables -I INPUT -p tcp --dport 22 -j ACCEPT
ufw allow 22/tcp

At least one of those works, worst case scenario one fails.

+4. Try disabling any firewall software on your computer. https://www.wikihow.com/Turn-Off-Firewall

+5. Try overriding something like fail2ban.

  • Find your IP here: https://ifconfig.me/
  • If your IP were 1.1.1.1, then run: iptables -I INPUT -s 1.1.1.1 -j ACCEPT

Hope that helps :)

Thanks! Port is blocked on my PC. Now I'll try to understand why.

Have another answer? Share your knowledge.