2

There are some weeks that I don't use the FTP server, and now I have tried to connect but it's returning this error. I did some "yum update", but I don't know what else has changed since then.

When I use the "proftpd -nd10" command, it returns:

...
    2018-12-07 03:22:37,259 server.example.com proftpd[5938] 127.0.0.1: Failed binding to ::, port 21: Address already in use
    2018-12-07 03:22:37,259 server.example.com proftpd[5938] 127.0.0.1: Check the ServerType directive to ensure you are configured correctly
    2018-12-07 03:22:37,259 server.example.com proftpd[5938] 127.0.0.1: Check to see if inetd/xinetd, or another proftpd instance, is already using ::, port 21
    2018-12-07 03:22:37,259 server.example.com proftpd[5938] 127.0.0.1: Unable to start proftpd; check logs for more details

When I use the "netstat -putan | grep :21" command, it returns:

tcp6       0      0 :::21                   :::*                    LISTEN      5937/proftpd: (acce 

If I stop the proftpd service, the port 21 becomes available. If I start again, the port became used again.

Here my config:

ServerType          standalone
ServerName          "server.example.com"
ServerIdent         on "FTP Server ready."
ServerAdmin         hostmaster@example.com
DefaultServer           on

# VRootEngine           on
DefaultRoot         ~ !adm
# VRootAlias            /etc/security/pam_env.conf etc/security/pam_env.conf

Port                21
PassivePorts            30000   35000

AuthPAMConfig           proftpd
AuthOrder           mod_auth_pam.c* mod_auth_unix.c

UseReverseDNS           off

User                nobody
Group               nobody

MaxInstances            20
UseSendfile         off
LogFormat           default "%h %l %u %t \"%r\" %s %b"
LogFormat           auth    "%v [%P] %h %t \"%r\" %s"

ExtendedLog             /var/log/proftpd/auth.log AUTH auth

#<IfDefine TLS>
  TLSEngine         on
  TLSRequired           on
  TLSRSACertificateFile     /etc/pki/tls/certs/proftpd/server.example.com.crt
  TLSRSACertificateKeyFile  /etc/pki/tls/certs/proftpd/server.example.com.key
  TLSCertificateChainFile   /etc/pki/tls/certs/proftpd/server.example.com-intermediate.crt  
  TLSCipherSuite        ALL:!ADH:!DES
  TLSOptions            NoCertRequest NoSessionReuseRequired
  TLSProtocol                   SSLv23
  TLSVerifyClient       off
  #TLSRenegotiate       ctrl 3600 data 512000 required off timeout 300
  TLSLog            /var/log/proftpd/tls.log
  <IfModule mod_tls_shmcache.c>
    TLSSessionCache     shm:/file=/var/run/proftpd/sesscache
  </IfModule>
#</IfDefine>

<IfDefine DYNAMIC_BAN_LISTS>
  LoadModule            mod_ban.c
  BanEngine         on
  BanLog            /var/log/proftpd/ban.log
  BanTable          /var/run/proftpd/ban.tab

  BanOnEvent            MaxLoginAttempts 2/00:10:00 01:00:00
  BanControlsACLs       all allow user ftpadm
</IfDefine>

<Global>
  Umask             022
  AllowOverwrite        yes

  <Limit ALL SITE_CHMOD>
    AllowAll
  </Limit>
</Global>

To be sure, I've changed my user's password, but nothing has changed.

  • What's the result of running: fuser -n tcp 21 ? – Nikhil_CV Dec 7 '18 at 6:36
  • returns "21/tcp: 5937" – dioo Dec 7 '18 at 6:38
  • Please grep the pid from : ps aux | grep 5937 or : ps -ef | grep 5937 – Nikhil_CV Dec 7 '18 at 6:43
  • "nobody 5937 0.0 0.1 179332 3484 ? Ss 04:44 0:00 proftpd: (accepting connections)" – dioo Dec 7 '18 at 6:48
  • Looks like proftpd is already running and listening on 21. Check the service status for proftp. Comment out the line starting "ftp" in /etc/inetd.conf and restart (killall -HUP inetd or something similar should do the trick) and try again. Please try accessing the server from a device using: ftp server.example.com and use the username and password you have configured. The logs will be written to : /var/log/messages . You can filter the logs to view only ftp related. – Nikhil_CV Dec 7 '18 at 7:02
1

In the proftpd.conf, I commented the line:

AuthOrder   mod_auth_pam.c* mod_auth_unix.c

restarted the proftpd service and now is working.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.