ProFTPD doesn't start

Hello Guys, in my vps ubuntu 16.04 LTS I can't to start ProFTPD server. If I go in Webmin --> Servers --> ProFTPD Server --> Start Server the result is:

Failed to start FTP server :
Starting proftpd (via systemctl): proftpd.serviceJob for proftpd.service failed because the control process exited with error code. See "systemctl status proftpd.service" and "journalctl -xe" for details.
failed!

In the command line if I launch

systemctl status proftpd.service

the result is:

# systemctl status proftpd.service
● proftpd.service - LSB: Starts ProFTPD daemon
   Loaded: loaded (/etc/init.d/proftpd; bad; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2017-09-07 08:21:03 UTC; 6min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 4644 ExecStart=/etc/init.d/proftpd start (code=exited, status=1/FAILURE)

Sep 07 08:21:03 cloud1.wpfast.eu systemd[1]: Starting LSB: Starts ProFTPD daemon...
Sep 07 08:21:03 cloud1.wpfast.eu proftpd[4644]:  * Starting ftp server proftpd
Sep 07 08:21:03 cloud1.wpfast.eu proftpd[4644]: 2017-09-07 08:21:03,868 cloud1.wpfast.eu proftpd[4684]: fatal: unknown configuration directive 'TLSEngine' on line 5 of '/etc/proftpd/conf.d/virtualmin.conf'
Sep 07 08:21:03 cloud1.wpfast.eu proftpd[4644]:    ...fail!
Sep 07 08:21:03 cloud1.wpfast.eu systemd[1]: proftpd.service: Control process exited, code=exited status=1
Sep 07 08:21:03 cloud1.wpfast.eu systemd[1]: Failed to start LSB: Starts ProFTPD daemon.
Sep 07 08:21:03 cloud1.wpfast.eu systemd[1]: proftpd.service: Unit entered failed state.
Sep 07 08:21:03 cloud1.wpfast.eu systemd[1]: proftpd.service: Failed with result 'exit-code'.

In the /etc/proftpd/conf.d/virtualmin the unknown configuration directive 'TLSEngine' is On

# chroot users into their home by default
DefaultRoot ~

# Enable TLS
TLSEngine                     on
TLSRequired                   on
TLSRSACertificateFile         /etc/ssl/certs/proftpd.crt
TLSRSACertificateKeyFile      /etc/ssl/private/proftpd.key
TLSOptions                    NoCertRequest
TLSVerifyClient               off
TLSLog                        /var/log/proftpd/tls.log
<IfModule mod_tls_shmcache.c>
  TLSSessionCache             shm:/file=/var/run/proftpd/sesscache
</IfModule>

# VirtualHost for SFTP (FTP over SSH) port
LoadModule mod_sftp.c
<VirtualHost 0.0.0.0>
  SFTPEngine on
  SFTPLog /var/log/proftpd/sftp.log

  # Configure the server to listen on 2222 (openssh owns 22)
  Port 2222

  # Configure the RSA and ECDSA host keys, using the same host key
  # files that OpenSSH uses.
  SFTPHostKey /etc/proftpd/ssh_host_rsa_key
  SFTPHostKey /etc/proftpd/ssh_host_ecdsa_key

  # Configure the file used for comparing authorized public keys of users.
  SFTPAuthorizedUserKeys file:~/.sftp/authorized_keys

  # Enable compression
  SFTPCompression delayed

  # More then FTP max logins, as there are more ways to authenticate
  # using SSH2.
  MaxLoginAttempts 6
</VirtualHost>

Please could anyone help me to resolve this problem? Best Mike

Files: 
Status: 
Closed (fixed)

Comments

Howdy -- thanks for all the logs and config details! That helps a lot.

I'll talk to Joe about why that issue is occurring, but what you could do in the meantime to get FTP up and running is to comment out the TLS related config options.

That is, the 7 lines beginning with the word "TLS" underneath where it says "# Enable TLS" -- try commenting all those out by putting a "#" at the beginning of the line, then restart FTP.

I'm going to check with Joe to see whether those are part of the distros config, or whether Virtualmin is adding those.

But let us know if commenting those out does the trick.

Andrey, thank you! You're a SuperHero! Commented the 7 lines and it runs! Thank you again. Best Mike

Hi guys,

@andreychek Same here on Debian 9.1 fresh server install today.

Your comment to comment-out the lines in the conf.d/virtualmin.conf file work fine.

Not having PtoFTPd working isn't really an issue for me, as I only ever use SFTP for connecting to servers via FTP clients.

If you'd like me to check anything in my conf files, etc, to help you identify/resolve the issue, please let me know what you'd like and I'll upload it here.

Regards.

Hi Guys,

Instead of commenting out the TLS lines just add at top of the file LoadModule mod_tls.c and enjoy the benefits of SFTP.

The full /etc/proftpd/conf.d/virtualmin.conf file on Ubuntu 16.04 TLS will looks like bellow:


DefaultRoot ~

# Enable TLS

LoadModule mod_tls.c
TLSEngine                     on
TLSRequired                   on
TLSRSACertificateFile         /etc/ssl/certs/proftpd.crt
TLSRSACertificateKeyFile      /etc/ssl/private/proftpd.key
TLSOptions                    NoCertRequest
TLSVerifyClient               off
TLSLog                        /var/log/proftpd/tls.log

<IfModule mod_tls_shmcache.c>
  TLSSessionCache             shm:/file=/var/run/proftpd/sesscache
</IfModule>

# VirtualHost for SFTP (FTP over SSH) port
LoadModule mod_sftp.c


<VirtualHost 0.0.0.0>
  SFTPEngine on
  SFTPLog /var/log/proftpd/sftp.log

  # Configure the server to listen on 2222 (openssh owns 22)
  Port 2222

  # Configure the RSA and ECDSA host keys, using the same host key
  # files that OpenSSH uses.
  SFTPHostKey /etc/proftpd/ssh_host_rsa_key
  SFTPHostKey /etc/proftpd/ssh_host_ecdsa_key

  # Configure the file used for comparing authorized public keys of users.
  SFTPAuthorizedUserKeys file:~/.sftp/authorized_keys

  # Enable compression
  SFTPCompression delayed

  # More then FTP max logins, as there are more ways to authenticate
  # using SSH2.
  MaxLoginAttempts 6
</VirtualHost>

I hope this will help.

@fricoman & @andreychek

Yup, that works too. Looks like that's the missing line from the virtualmin config.

Thanks @fricoman

I've added this line

# VirtualHost for SFTP (FTP over SSH) port
LoadModule mod_sftp.c

but unfortunately in my Ubuntu 16.04 the result is

fatal: unknown configuration directive 'TLSEngine' on line 5 of '/etc/proftpd/conf.d/virtualmin.conf'

Best way for my server is commented first 7 line as said above. Thank you for your help. Best Mike

If you happen to have a moment for additional troubleshooting, does it work to add this line to that file:

LoadModule mod_tls.c

Does that get those TLS-related lines working for you?

Hi @andreychek

Yes. Adding that line to the originally installed (unmodified) version of /etc/proftpd/conf.d/virtualmin.conf does resolve the issue, on Debian 9.1

$ service proftpd start ...returns no errors, and the daemon is running.

$ ps -ef | grep proftpd proftpd 12027 1 0 13:09 ? 00:00:00 proftpd: (accepting connections)

Let me know if you need any snippets from the install log.

Hi @andreychek,

Adding LoadModule mod_tls.c virtualmin returns me this:

Failed to apply FTP configuration :
Checking syntax of configuration file
2017-09-10 09:42:45,591 cloud1.wpfast.eu proftpd[7209]: mod_dso/0.5: module 'mod_sftp.c' already loaded
2017-09-10 09:42:45,592 cloud1.wpfast.eu proftpd[7209]: fatal: unknown configuration directive 'TLSEngine' on line 5 of '/etc/proftpd/conf.d/virtualmin.conf'

Thank you Mike

@andreychek yes, I've un-commented the 7 lines that I commented out before.

Miloshio's picture
Submitted by Miloshio on Tue, 09/12/2017 - 07:53

For anyone suffering this misconfiguration, the key part is to load module tls.c before including conf.d dir, where virtualmin config resides.

LoadModule mod_tls.c

Include /etc/proftpd/conf.d

Joe's picture
Submitted by Joe on Thu, 09/14/2017 - 22:33 Pro Licensee

For anyone coming into this thread in the future:

Make sure you have the latest virtualmin-config package and run the following:

# virtualmin config-system --include ProFTPd

This assumes you're running a system installed with the 6.0.x version of the install script. Old systems with ProFTPd problems should not follow this step; the manual step suggested by Miloshio is fine (for some categories of this problem...there's actually two different causes for similar symptoms depending on whether it's a CentOS or Debian/Ubuntu system...the virtualmin config-system --include ProFTPd command fixes either problem).

If you're getting a "config-system.pl was not found" message, that indicates that you're not dealing with a new install... we can still help, but you'd want to open a new request, as it's a different problem than what's described above.

hi guys i'm using Ubuntu 16.04.3 server i have the same error when i run "sudo service proftpd restart"

"Job for proftpd.service failed because the control process exited with error code. See "systemctl status proftpd.service" and "journalctl -xe" for details."

i followed the all comments. but i have a problem ! there is no file in "/etc/proftpd/conf.d" how can i find this file name:

chroot users into their home by default

DefaultRoot ~

Enable TLS

TLSEngine on TLSRequired on TLSRSACertificateFile /etc/ssl/certs/proftpd.crt TLSRSACertificateKeyFile /etc/ssl/private/proftpd.key TLSOptions NoCertRequest TLSVerifyClient off TLSLog /var/log/proftpd/tls.log TLSSessionCache shm:/file=/var/run/proftpd/sesscache

VirtualHost for SFTP (FTP over SSH) port

LoadModule mod_sftp.c SFTPEngine on SFTPLog /var/log/proftpd/sftp.log

# Configure the server to listen on 2222 (openssh owns 22) Port 2222

# Configure the RSA and ECDSA host keys, using the same host key # files that OpenSSH uses. SFTPHostKey /etc/proftpd/ssh_host_rsa_key SFTPHostKey /etc/proftpd/ssh_host_ecdsa_key

# Configure the file used for comparing authorized public keys of users. SFTPAuthorizedUserKeys file:~/.sftp/authorized_keys

# Enable compression SFTPCompression delayed

# More then FTP max logins, as there are more ways to authenticate # using SSH2. MaxLoginAttempts 6

If you look in /var/log/syslog after that error occurs, you should see a ProFTPd error message... what error are you seeing?

The error should include the file that the problem is occurring in.

This is the error i got in /var/log/syslog I uploaded a jpg file

and this is the error i got in webmin when i'm starting ProFTPD "Failed to start FTP server : Starting proftpd (via systemctl): proftpd.serviceJob for proftpd.service failed because the control process exited with error code. See "systemctl status proftpd.service" and "journalctl -xe" for details. failed! "

What does the line mentioned in the attached error message contain on your system?

Hi,

Just to let you know that « virtualmin config-system --include ProFTPd » worked for me. Many thanks (after searched some time for a fix !).

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

I am still having problem!

Solved creating a temp SSL cert:

launch /etc/ssl/certs/proftpd-gencert