proftpd not running and unable to start

7 posts / 0 new
Last post
#1 Wed, 01/27/2016 - 06:54
rnd

proftpd not running and unable to start

Hi,

I installed virtualmin yesterday and everything seems to work fine except FTP.

I cannot start proftpd whenever I click "start" the following error is thrown:

Failed to start FTP server :

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

The journalctl -xe shows some usefull info:

proftpd: fatal: SFTPHostKey: Unable to use '/etc/ssh/ssh_host_rsa_key' as host key, as it is group- or world-accessible on line 436 of '/etc/proftpd.conf'

I tried finding a solution using google but I cannot find anything related to proftpd and virtualmin. I am not too experienced in Linux aswel (still learning) so I do not feel comfortable editing things without knowing what it does.

I would appreciate any help regarding this issue

Wed, 01/27/2016 - 08:41
andreychek

Howdy,

If you look in the ProFTPd config file, do you see some sort of option regarding the SFTPHostKey?

If so, does commenting that out allow ProFTPd to start?

-Eric

Wed, 01/27/2016 - 16:38
joe443

Try this:

chmod og= /etc/ssh/ssh_host_rsa_key

Also, please see my recent posting https://www.virtualmin.com/node/39445.

Wed, 02/10/2016 - 07:27
thathwamasi

To resolve this, Comment the lines

SFTPEngine on
Port 2222
SFTPLog /var/log/proftpd/sftp.log

"# SFTPHostKey /etc/ssh/ssh_host_rsa_key" "# SFTPHostKey /etc/ssh/ssh_host_dsa_key"

LIne number 435 and 436 restart proftpd

Fri, 06/17/2016 - 07:18 (Reply to #4)
Abdul Rehman

Nice work, thank you very much....

Thu, 09/01/2016 - 09:41
DonPeek

Thanks.. Also.. Just had this on a new install Redhat7 on AWS ..

Don Peek

Wed, 12/14/2016 - 17:18
darioj

You can generate new host keys just for sftp:

ssh-keygen -f /etc/ssh/sftp_host_rsa_key -N '' -t rsa
ssh-keygen -f /etc/ssh/sftp_host_dsa_key -N '' -t dsa

Make sure only root can read or write them and change your proftpd.conf to pick the new files

SFTPHostKey /etc/ssh/sftp_host_rsa_key
SFTPHostKey /etc/ssh/sftp_host_dsa_key

sshd is running on another port anyhow, in my opinion it will not generate the confusion stated in the docs.

Topic locked