LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   proftpd configuration (https://www.linuxquestions.org/questions/linux-networking-3/proftpd-configuration-264449/)

Permaximus 12-09-2004 09:03 AM

proftpd configuration
 
I am following the tutorial on this site to configure an ftp using proftpd and I am sort of in a rut. I have the program configured and everything, I edited the config file to what I wanted it to be. But before I installed I tried running in by
ftp localhost
This is the output that I got:
[root@localhost proftpd-1.2.10]# ftp localhost Connected to localhost (127.0.0.1).
421 Service not available, remote server has closed connection
ftp>


I dont really know what the problem is. Any helpis greatly appreciated. If you need me to post my config file then I can. Thanks.

druuna 12-09-2004 11:42 AM

Just guessing here, you might want to post your config file if my suggestions don't get you anywhere.

- Did you set up an anonymous only config?
- Are the Allow and Deny entries ok?

-Did you check your /etc/xinetd.conf settings? Maybe the (ftp) service is bound to
some other ip adress (bind = 0.1.2.3).

Hope this helps.

Permaximus 12-10-2004 08:38 AM

It is actually set to NOT allow anonymous logins. I am not quite sure what you mean by Allow and Deny Entries. And I looked at /etc/xinetd.conf and there was nothing about ftp that I saw. So here is my config file. Thank you.

# This is a basic ProFTPD configuration file (rename it to
# 'proftpd.conf' for actual use. It establishes a single server
# and a single anonymous login. It assumes that you have a user/group
# "nobody" and "ftp" for normal operation and anon.

ServerName "ProFTPD Default Installation"
ServerType standalone
DefaultServer on

# Port 21 is the standard FTP port.
Port 21

# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask 022

# To prevent DoS attacks, set the maximum number of child processes
# to 30. If you need to allow more than 30 concurrent connections
# at once, simply increase this value. Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd).
MaxInstances 5

# Set the user and group under which the server will run.
User caleb
Group nobody

# To cause every FTP user to be "jailed" (chrooted) into their home
# directory, uncomment this line.
#DefaultRoot ~

# Normally, we want files to be overwriteable.
AllowOverwrite on

# Bar use of SITE CHMOD by default
<Limit SITE_CHMOD>
DenyAll
</Limit>

# Bar use of SITE CHMOD by default
<Limit SITE_CHMOD>
DenyAll
</Limit>

druuna 12-10-2004 03:17 PM

The way you set it up xinetd isn't used (ServerType standalone), so your xinetd.config looks ok (only talking ftp, ofcourse :) ).

Only thing I see that I should do different (and you probably should) is the User under which the ftpd server runs (User caleb).

Leave it to what proftpd uses (user nobody), or create a special user/group for it.

Here's an example config I use for my local network (IP numbers are fake). It listens on 1.2.100.5 a 100 Mb network. It also binds (listens) on 127.0.0.1 (localnet) and 1.2.10.5 (10 Mb network):
Code:

# -------------------------------------------------------------------------- #
# /etc/proftpd.conf
# -------------------------------------------------------------------------- #

ServerName          "Inferno"
ServerType          standalone
DefaultServer      on
ServerIdent        off
Port                21
SyslogFacility      ftp
SyslogLevel        info
DefaultAddress      1.2.100.5
Bind                127.0.0.1
Bind                1.2.10.5
DeferWelcome        on
AccessGrantMsg      "Welcome to inferno."
ScoreboardFile      /etc/proftpd.scoreboard
Umask              022
MaxInstances        10
User                proftpd
Group              proftpd
<Directory />
  AllowOverwrite    on
</Directory>
# -------------------------------------------------------------------------- #
# End

You migth not need/want the Listen and 2 Bind entries. Just delete them if you don't. Instead of listening to 3 specific ip numbers you will listen on port 21 of all ip numbers.

About the 421 error. Don't know if you checked it's meaning, but it doeas suggests that ftpd is actually working and could be related to an authentication problem.

That's why I suggest loosing Caleb as user and put a more 'daemon dedicated' user in it's place.

Hope this gets you going again.

Permaximus 12-13-2004 08:53 AM

I got the ftp up and running. I could ftp into localhost and exectue commands and everything, but after I installed it is giving me this 421 Service not available, remote server has closed connection crap again. It cant be my config file can it? Because I had it up and running. What could it be?

druuna 12-13-2004 12:00 PM

Hi,

Quote:

I got the ftp up and running. I could ftp into localhost and exectue commands and everything, but after I installed it is giving me this
This is not clear to me. To be able to log on to an ftp server (localy or remote) an ftpd server needs to be installed and configured. What did you actually do after it worked localy? Did you change any settings?

Quote:

It cant be my config file can it? Because I had it up and running. What could it be?
You do not tell what you changed and what the config looks like. Did you apply any of the 'tips' I gave. Without any extra info I cannot exclude your config file as being the cause of the problem.

Like I stated before, the 421 error is probably related to an authentication problem (is proftpd running with a valid user/group, are users correct. do they have a valid password etc.).

Permaximus 12-13-2004 11:07 PM

I am pretty sure you can run it before install. I executed the command: /usr/src/proftpd-1.2.8/proftpd -c /usr/src/proftpd-1.2.8/sample-configurations/basic.conf and it logged in to localhost. After I did that it worked perfectly. Then I typed make install and it installed seamlessly. I didnt change any settings or anthing in the config file. I checked all the user groups and they all seem fine. I just dont understand how it worked and then didnt. It seems kind of random to me. :confused: Thanks for being so paitent.

bathory 12-14-2004 02:52 AM

You can run:
Code:

proftpd -t
to test your config and:
Code:

proftpd -n -d 9
to debug proftpd


All times are GMT -5. The time now is 12:40 PM.