5

I have Rapsberry Pi B+ with Arch Linux installation. uname reports version:

[computer@computer001 ~]$ uname -a
Linux computer001 3.18.3-3-ARCH #1 PREEMPT Mon Jan 26 20:10:28 MST 2015 armv6l GNU/Linux

I've installed ftp server via pacman -S vsftpd and installation has passed without any errors. Then I tried to configure it, which resulted in following vsftpd.conf:

anonymous_enable=NO
local_enable=YES
write_enable=YES
#local_umask=022
anon_upload_enable=NO
anon_mkdir_write_enable=NO
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
chown_uploads=YES
chown_username=computer
#xferlog_file=/var/log/vsftpd.log
#xferlog_std_format=YES
#idle_session_timeout=600
#data_connection_timeout=120
#nopriv_user=ftpsecure
#async_abor_enable=YES
#ascii_upload_enable=YES
#ascii_download_enable=YES
ftpd_banner=Welcome to personal ftp service.
#deny_email_enable=YES
#banned_email_file=/etc/vsftpd.banned_emails
#chroot_local_user=YES
#chroot_list_enable=YES
#chroot_list_file=/etc/vsftpd.chroot_list
ls_recurse_enable=YES
listen=YES
#listen_ipv6=YES

Now, when I try to restart vsftpd, I get:

[computer@computer001 etc]$ sudo systemctl restart vsftpd.service && systemctl status -l vsftpd.service
* vsftpd.service - vsftpd daemon
   Loaded: loaded (/usr/lib/systemd/system/vsftpd.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Thu 1970-01-01 06:32:24 UTC; 112ms ago
  Process: 350 ExecStart=/usr/bin/vsftpd (code=exited, status=2)
 Main PID: 350 (code=exited, status=2)

Here is also output of sudo journalctl | grep -i vsftp:

Jan 01 06:32:24 computer001001 sudo[347]: computer001 : TTY=pts/0 ; PWD=/etc ; USER=root ; COMMAND=/usr/bin/systemctl restart vsftpd.service
Jan 01 06:32:24 computer001001 systemd[1]: Starting vsftpd daemon...
Jan 01 06:32:24 computer001001 systemd[1]: Started vsftpd daemon.
Jan 01 06:32:24 computer001001 systemd[1]: vsftpd.service: main process exited, code=exited, status=2/INVALIDARGUMENT
Jan 01 06:32:24 computer001001 systemd[1]: Unit vsftpd.service entered failed state.
Jan 01 06:32:24 computer001001 systemd[1]: vsftpd.service failed.

Here is unit script /usr/lib/systemd/system/vsftpd.service:

[Unit]
Description=vsftpd daemon
After=network.target

[Service]
ExecStart=/usr/bin/vsftpd
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process

[Install]
WantedBy=multi-user.target

If I run sudo /usr/bin/vsftpd, I get following error:

500 OOPS: config file not owned by correct user, or not a file

I have corrected file permissions for /etc/vsftpd.conf via sudo chown root:root /etc/vsftpd.conf and now manually server gets started. I am also aware date/time is not correct, I haven't setup it yet.What am I missing?

  • 1
    Does sudo journalctl | grep -i vsftp show any error messages? – Mark Plotnick Jan 27 '15 at 21:54
  • @MarkPlotnick, I've upgraded the question. – KernelPanic Jan 27 '15 at 22:17
  • 1
    Well the error is INVALIDARGUMENT. Take a look at the unit script and the man page to see if you can figure out which arg is invalid. – bahamat Jan 28 '15 at 12:53
  • @bahamat, I've added unit script listing, but inside of it I do not see any anomaly. – KernelPanic Jan 28 '15 at 14:25
  • 1
    Could you please list the permissions and ownership of the the vsftpd.conf file? – geekbass Jan 28 '15 at 18:47
3

step 1 : check the vsftpd.conf

listen=YES
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/private/vsftpd.pem

Step 2 : To View which ftp service is running use

$ lsof -i | grep ftp 

step 3 : To stop xinetd

$ sudo service xinetd stop

Step 4: After stopping xinetd restart your vsftpd service by typing

$ /etc/init.d/vsftpd restart
| improve this answer | |
2

I've reset the permissions for /etc/vsftpd.conf to root:root via sudo chown root:root /etc/vsftpd.conf and now the vsftpd server get started via sudo systemctl restart vsftpd.service and running it manually via sudo /usr/bin/vsftpd.

| improve this answer | |
0

If someone stumble upon this problem with vsftpd, please check what error do you get by command:

/usr/sbin/vsftpd /etc/vsftpd.conf

If it is:

500 OOPS: SSL: cannot load RSA private key

Then regenerate SSL certificate (or reissue from your provider):

sudo openssl req -x509 -nodes -days 1095 -newkey rsa:2048 -keyout /etc/ssl/private/vsftpd.pem -out /etc/ssl/private/vsftpd.pem

My working /etc/vsftpd.conf:

anonymous_enable=NO
connect_from_port_20=YES
dirmessage_enable=YES
force_local_data_ssl=YES
force_local_logins_ssl=YES
listen_ipv6=YES
listen=NO
local_enable=YES
local_umask=022
pam_service_name=vsftpd
pasv_enable=Yes
pasv_max_port=10200
pasv_min_port=10100
rsa_cert_file=/etc/ssl/private/vsftpd.pem
rsa_private_key_file=/etc/ssl/private/vsftpd.pem
secure_chroot_dir=/var/run/vsftpd/empty
ssl_ciphers=HIGH
ssl_enable=YES
ssl_sslv2=NO
ssl_sslv3=NO
ssl_tlsv1=YES
use_localtime=YES
write_enable=YES
xferlog_enable=YES
| 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.