How do I troubleshoot netcat on a droplet?

I’m running a Debian VPS and I’ve been trying to connect to it via netcat (and some other python scripts I’ve been working on). I can connect to anything on my LAN by entering netcat -l 5555 on the remote machine and netcat IP_ADDRESS 5555 on my local machine and it works fine. When I try to ssh through my droplet and open up a port for listening however I cannot get it to connect. It just stalls on Listening on [] (family 0, port 55555) and when I send out a connection request from my local machine I don’t hear anything back.

Any suggestions? I have a feeling there is something blocking my ports (would a firewall do this?) I don’t think I set one up when I set up my droplet but I was following a tutorial and it was my first server I’d set up so I could have done a bunch of things and not remember :)

Thanks a bunch


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

A firewall could cause this if it was configured to reject traffic on the port you indicated. An easy way to check this would be to briefly turn off your firewall to run your test. If you’re then able to connect you will need to dig into your firewall configuration to open the needed port.

If you’re on ubuntu it’s likely you’re using ufw:

service ufw stop

then once you’ve run your test, be sure to start it back up again:

service ufw start

If you’re on another distro you can substitute iptables for ufw in those two commands.