I had an issue recently using SamKirklands FTP-based Github push Action. I wanted to try use the Ruby action to build my Jekyll site on Githubs servers then deploy to a cpanel based shared hosting account.
The concept would be good for some of my future clients. This right now would be good for pushing Nechtet out while I’m at both home and work.
Unfortunately I had an issue with my FTP server and I never really had a chance to look into it. Finally got the time, and did a little research.
The following is an example of the output
[root@host01 ~]# ftp example.com
Connected to example.com (117.20.7.123).
220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 1 of 50 allowed.
220-Local time is now 07:38. Server port: 21.
220-This is a private system - No anonymous login
220-IPv6 connections are also welcome on this server.
220 You will be disconnected after 15 minutes of inactivity.
Name (example.com:root): example@example.com
331 User example@example.com OK. Password required
Password:
230 OK. Current restricted directory is /
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
227 Entering Passive Mode (117,20,7,123,238,99)
ftp: connect: Connection timed out
ftp>
When you FTP into a host, your machine connects to that FTP server via TCP Port 21. Your client has two modes; active and passive.
Active mode is where the FTP server connects back into the client over an opened port. You’ll be able to make the request out to the server but the server can’t talk back to your client because you obviously wont have port 20 open for it.
Passive mode opens a random port on the server, within a predfined range, which allows the client to communicate with the server. I dont have time to go into more detail on this; I invite commentary; whatever@nechtet.com
The crux of this is that your FTP is very likely running on ports that you hadn’t opened yet. You have to check your FTP implementation; ProFTPd on cPanel uses it’s own ports, and it changes between cPanel versions.
You can check your FTPd configuration to find it’s defined passive ports. This is the easiest way to figure out what you need to open.