Ask Your Question
0

Can't get any FTPd working

asked 2017-08-19 09:48:05 -0500

rwbehne1 gravatar image

I installed 3 different FTP servers, and not one would work right, they all display the same exact symptom.

Using ftp from a terminal [ftp behne.ddns.net] for an anonymous login, I can get logged in just fine, and I can use the help command, but ls hangs until it times out, never giving a file listing. From a web browser [ftp://behne.ddns.net/] you just get a blank screen, until it times out.

I prefer to use vsftpd, (which is what's currently installed,) but proftpd and pure-ftpd also failed in exactly the same way. It looks like this:

bash-4.4$ ftp behne.ddns.net
Connected to behne.ddns.net (112.208.203.179).
220 (vsFTPd 3.0.3)
331 Please specify the password.
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> help
Commands may be abbreviated.  Commands are:

!               debug           mdir            sendport        site
$               dir             mget            put             size
account         disconnect      mkdir           pwd             status
append          exit            mls             quit            struct
ascii           form            mode            quote           system
bell            get             modtime         recv            sunique
binary          glob            mput            reget           tenex
bye             hash            newer           rstatus         tick
case            help            nmap            rhelp           trace
cd              idle            nlist           rename          type
cdup            image           ntrans          reset           user
chmod           lcd             open            restart         umask
close           ls              prompt          rmdir           verbose
cr              macdef          passive         runique         ?
delete          mdelete         proxy           send
ftp> ls
227 Entering Passive Mode (112,208,203,179,156,94).421 Timeout.
ftp: connect: Connection refused
ftp>

I had the exact same problem when I was using OpenSUSE, but have just installed Fedora, and the problem is here again on this completely new install. No one in that other list could help, they kept blaming me for an incorrect config, and that wasn't the problem. Are there any FTPd experts who can help solve this problem? I've had it for nearly a year now.

edit retag flag offensive close merge delete

Comments

Odds are 8 to 2 that this is a firewall issue. You can try to run an ftp client on system behne.ddns.net itself and connect to 127.0.0.1.

villykruse gravatar imagevillykruse ( 2017-08-19 10:52:01 -0500 )edit

Hi. Run sudo setenforce 0 and try again and see if the problem still persists, and let me know about the results.

hedayat gravatar imagehedayat ( 2017-08-19 15:58:06 -0500 )edit

Ok, I tried 127.0.0.1 anyway, it never worked on OpenSUSE, but surprisingly it does now. So apparently it actually is a firewall problem. What to do?

I tried setenforce but it had no effect, so I re-enabled it.

rwbehne1 gravatar imagerwbehne1 ( 2017-08-20 03:37:17 -0500 )edit

Great, if you have not opened the ftp port in firewall, you should do it (I'm sure @villykruse will provide a complete answer). But I wonder how you can get logged in...

hedayat gravatar imagehedayat ( 2017-08-20 03:58:34 -0500 )edit

Perhaps the problem isn't with port 21, but the data on port 20. How is the firewall supposed to be set up for FTP anyway? I'm not used to the way Fedora does things, so someone has to guide me.

rwbehne1 gravatar imagerwbehne1 ( 2017-08-20 04:26:09 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-08-20 05:08:04 -0500

villykruse gravatar image

In this case the server sets up a listen port 40030 Passive Mode (112,208,203,179,156,94) 156 * 256 + 94. Thus the server firewall needs to enable incoming call to that port. It does that by analysing the traffic on port 21 and dynamically enable the data port temporarily. The data port is different for every data transfer, so there is never a fixed port you can open.

When using firewalld and firewall-config, you need to open the ftp service, and it would do the Right Thing. Something similar should be done on any router firewalls you may have or your ISP may have.

edit flag offensive delete link more

Comments

I agree that opening the ftp service in firewall-config will make it do the right thing. When I try to connect to ftp://localhost or behne.ddns.net I get:

# ftp behne.ddns.net
Connected to behne.ddns.net (112.208.203.179).
220 (vsFTPd 3.0.3)
331 Please specify the password.
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> 

So the firewall is open. My router has always been set up for all my servers, with proper port forwarding to my host, and It always worked before.

rwbehne1 gravatar imagerwbehne1 ( 2017-08-20 13:24:00 -0500 )edit

Are you sure your router/modem understands the ftp protocol. If not there is no way it can forward the data connection to anywhere.

villykruse gravatar imagevillykruse ( 2017-08-20 13:50:47 -0500 )edit

As I said before, My router has always been set up for all my servers, with proper port forwarding to my host, and It always worked before. The problem began when I installed OpenSUSE 42.2, and now that I have installed the latest Fedora it's even worse, since now I can't figure out how to get ANY servers running!

I know the data connection (which is outgoing) doesn't get forwarded, only incoming connections are forwarded to my Linux host. Since nothing has changed in the router, the problem must be in that which was changed - the installation of the new OS: Fedora.

rwbehne1 gravatar imagerwbehne1 ( 2017-08-21 04:00:53 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2017-08-19 09:48:05 -0500

Seen: 275 times

Last updated: Aug 20 '17