I am having a problem trying to set up an FTPS server on my Ubuntu Server 13.10 machine. I have vsftpd installed.
When I try to start the service using sudo service vsftpd start
I get :
vsftpd start/pre-start, process 5922
However, ps aux | grep vsftpd
yields nothing.
I found this error in /var/log/dmesg
:
[ 11.212518] init: vsftpd main process (1137) terminated with status 2
The result of sudo vsftpd
is:
500 OOPS: SSL: cannot load RSA certificate
The permissions on \etc\vsftpd\vsftpd.pem
are currently set to:
-rw-r--r-- 1 root root 1708 Jan 28 05:15 vsftpd.pem
I tried changing the permissions to 777 and it still didn't work.
I used the following command to create the certificate:
openssl req -x509 -nodes -days 720 -newkey rsa:2048 -keyout /etc/vsftpd/vsftpd.pem -out /etc/vsftpd/vsftpd.pem
My /etc/vsftpd.conf
is as follows:
listen=YES
anonymous_enable=NO
write_enable=YES
local_umask=022
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=NO
xferlog_file=/var/log/vsftpd.log
chroot_local_user=YES
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/vsftpd/vsftpd.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
listen_port=2000
ssl_enable=YES
allow_anon_ssl=NO
force_local_data_ssl=YES
force_local_logins_ssl=YES
ssl_tlsv1=YES
ssl_sslv2=NO
ssl_sslv3=NO
hide_ids=YES
max_per_ip=10
max_clients=10
port_enable=YES
pasv_enable=YES
pasv_min_port=11000
pasv_max_port=11030
require_ssl_reuse=NO
Any help would be greatly appreciated, as I am officially drawing a total blank.
Thanks in advance.
UPDATE:
I just tried it with:
rsa_cert_file=/etc/ssl/private/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
It worked. So I'm thinking that I messed up the certificate generation. I don't really know enough about OpenSSL to figure it out any further.
I figured it out. I changed the openssl generation command from:
openssl req -x509 -nodes -days 720 -newkey rsa:2048 -keyout /etc/vsftpd/vsftpd.pem -out /etc/vsftpd/vsftpd.pem
to:
openssl req -x509 -nodes -days 720 -newkey rsa:2048 -keyout /etc/vsftpd/vsftpd.key -out /etc/vsftpd/vsftpd.pem
Resulting in a
/etc/vsftpd/vsftpd.pem
and a/etc/vsftpd/vsftpd.key
.I updated
/etc/vsftpd.conf
and the service started right up.