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

As it is in the topic the problem is with vsftpd. For some time i used it normally and everything worked good. But once i started vsftpd and it gave out the message:

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

After some searching i tried:

  • to change the owner of the vsftpd.conf file by sudo chown root vsftpd.conf;

  • to remove vsftpd and install again;

  • to purge vsftpd and install again;
  • to delete the content of the conf file and paste examples from internet.

Nothing helped, it did not work since.
It is Ubuntu 16.04

Thank you in advance.

Asked By: fruit_alchemist

||

I don’t know if you still need this, but I had the same problem recently I Google around and found This Page. The major difference I found was that I was trying to start the server by typing:

# vsftpd

Instead of:

# systemctl start vsftpd

in the terminal. I hope this helped.

Answered By: Andrew Eliyah

$ vsftpd &
[1] 7685
500 OOPS: config file not owned by correct user, or not a file

The error is seen while running vsftpd as a background process.
I could not resolve the error, but I successfully ran the service.

Running the following command’s(In Ubuntu) worked out for me:

$ sudo chown root:root /etc/vsftpd.conf
$ ls -lt  /etc/vsftpd.conf 
-rwxr-xr-x 1 root root 4429 Sep 12 00:26 /etc/vsftpd.conf
$ sudo service vsftpd start
$ sudo service vsftpd status
vsftpd.service - vsftpd FTP server
Loaded: loaded (/lib/systemd/system/vsftpd.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2019-09-12 00:47:46 IST; 4s ago
Process: 7882 ExecStartPre=/bin/mkdir -p /var/run/vsftpd/empty (code=exited, status=0/SUCCESS)
Main PID: 7883 (vsftpd)
Tasks: 1 (limit: 4531)
CGroup: /system.slice/vsftpd.service
        └─7883 /usr/sbin/vsftpd /etc/vsftpd.conf
Sep 12 00:47:46 <Mysystemname>-G1 systemd[1]: Starting vsftpd FTP server...
Sep 12 00:47:46 <Mysystemname>-G1 systemd[1]: Started vsftpd FTP server.

Note: After this status, the FTP was successfully running on port 21.

$ nmap 127.0.0.1
  Starting Nmap 7.60 ( https://nmap.org ) at 2019-09-12 00:50 IST
  Nmap scan report for localhost (127.0.0.1)
  Host is up (0.00012s latency).
  Not shown: 997 closed ports
  PORT    STATE SERVICE
  21/tcp  open  ftp
Answered By: user995055

"Virtual" users

If you have, in your root:root-owned /etc/vsftpd.conf, something like

user_config_dir=/etc/vsftpd/users

so that user joe uses further config in /etc/vsftpd/users/joe, well, then that directory and that file must also be owned by root and not world readable.

The difference is that in this case the 500 OOPS will only be shown after a successful login (i.e. once vsftpd has determined that you are user joe, and may then read the appropriate configuration file).

Answered By: LSerni

This answer was a good indication to find the problem.
In my case next commands were the cause:

#*** block access to shell in two steps ****

#1) assign the user’s shell to false
usermod -s /bin/false

#2) add false to the shell list
echo /bin/false >> /etc/shells

after commenting them out the server started.
So,first make sure that the server runs with your admin user then do things with other users as a ftp user.

Answered By: Fidel Salazar
Categories: Answers Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.