0

I've installed Pure-ftpd on my CentOS 6.4 server, after configuring the server I ran /etc/init.d/pure-ftpd start ; /etc/init.d/xinetd restart and it indicates that the service has started successfully. But when I try to connect to the server in port 21 I get the following error: ftp: connect: Connection refused, when I run netstat it shows that the port is not open. My /etc/pure-ftpd.conf look like that:

AllowAnonymousFXP           no
AllowUserFXP                no
AltLog                     clf:/var/log/pureftpd.log
AnonymousCanCreateDirs      no
AnonymousCantUpload         yes
AnonymousOnly               no
AntiWarez                   yes
AutoRename                  no
BrokenClientsCompatibility  yes
CallUploadScript yes
ChrootEveryone              yes
CustomerProof              yes
Daemonize                   yes
DisplayDotFiles             yes
DontResolve                 yes
LimitRecursion              7500 8
MaxClientsNumber            50
MaxClientsPerIP             8
MaxDiskUsage               99
MaxIdleTime                 180
MaxLoad                     4
MinUID                      500
NoAnonymous                 yes
PAMAuthentication             yes
ProhibitDotFilesRead        no
ProhibitDotFilesWrite       no
PureDB                        /etc/pure-ftpd/pureftpd.pdb
SyslogFacility              ftp
Umask                       133:022
UseFtpUsers                 no
VerboseLog                  yes

/etc/xinetd.d/pure-ftpd:

service ftp
{
        disable = yes
        socket_type             = stream
        wait                    = no
        user                    = root
        server                  = /usr/sbin/pure-config.pl
        server_args             = /etc/pure-ftpd/pure-ftpd.conf
        log_on_success          += DURATION USERID
        log_on_failure          += USERID
        nice                    = 10
}

/etc/pam.d/pure-ftpd looks like that: [root@amaftp ~]# cat /etc/pam.d/pure-ftpd

#%PAM-1.0
# Sample PAM configuration file for Pure-FTPd.
# Install it in /etc/pam.d/pure-ftpd or add to /etc/pam.conf
auth       required     pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed
auth       include      system-auth
auth       required     pam_shells.so
auth       required     pam_nologin.so
account    include      system-auth
password   include      system-auth
session    include      system-auth

[root@amaftp ~]# I am not using pure-ftp-ldap/mysql/pgsql. If i run /usr/sbin/pure-ftpd the port opens successfully and I am able to connect, but I want it to run as daemon and I want xinetd to manage it. Nothing is getting written to the log and the log file isn't even created in /var/log In addition, I have the exact same configuration on another server and it works there like a charm, what could be the reason for the fail? Thanks

Itai Ganot
  • 10,424
  • 27
  • 88
  • 143
  • Can you try to set `Daemonize` to `no` in `/etc/pure-ftpd.conf` and change `disable = yes` to `disable = no` in `/etc/xinetd.d/pure-ftpd` ? – krisFR Dec 31 '13 at 14:48
  • Done, after restarting both `pure-ftpd` and `xinetd` services, I tried to connect to the ftp server and got this: `itaig@itaig-lt:~$ ftp 192.168.57.16 Connected to 192.168.57.16. Running: /usr/sbin/pure-ftpd -A -b -c50 -C8 -d -D -E -fftp -H -I180 -lpuredb:/etc/pure-ftpd/pureftpd.pdb -lpam -L7500:8 -m4 -s -U133:022 -u500 -i -Oclf:/var/log/pureftpd.log -o -k99 -Z ftp>` – Itai Ganot Dec 31 '13 at 14:52
  • `Connected to 192.168.57.16` so seems to work, right ? – krisFR Dec 31 '13 at 15:00
  • Well no, Otherwise I would be asked to enter username and password and it didn't. – Itai Ganot Dec 31 '13 at 15:10
  • Keep every change we made, and in file `/etc/xinetd.d/pure-ftpd` replace the value for `server =` by `/usr/sbin/pure-ftpd` instead of `/usr/sbin/pure-config.pl` – krisFR Dec 31 '13 at 16:17
  • ok, i've been able to setup and loggin using pure-ftpd and xinetd on my CentOS lab. But before posting an answer i would like to be sure about the authentication type you want : linux, pure-ftpd, pam ? in case it is pam, which one ? ldap, other ? – krisFR Jan 01 '14 at 19:14
  • Yes, PAM and ldap, i did what you told me and it works but users i've added are unable to log into the ftp server – Itai Ganot Jan 02 '14 at 13:06
  • So if you are using LDAP to authnticate users, you should have this directive in your `pure-ftpd.conf` file : `LDAPConfigFile /etc/pure-ftpd/pureftpd-ldap.conf`, and in this file, all infos about your LDAP schema – krisFR Jan 02 '14 at 20:24

0 Answers0