AnswerBun.com

How to fix vsftpd error: 500 OOPS: cannot change directory

Server Fault Asked by i3i5i7 on January 1, 2022

I am trying to setup vsftpd for anonymous-only, read-only access on my Ubuntu 20.04 VM. Home directory is /home/ftp/filebase. When I try to login, I get the error

500 OOPS: cannot change directory: "/home/ftp/filebase"

and am kicked out.

There are a few questions on this here already. Most suggest to disable SELinux (not installed here) or to adjust directory permissions to give access up to the top:

# ls -al
total 2097232
drwxr-xr-x   4 root root       4096 Jul 24 18:32 home
/home# ls -al
drwxr-xr-x  3 ftp   ftp   4096 Jul 24 18:34 ftp
/home/ftp# ls -al
drwxr-xr-x   3 ftp  ftp  4096 Jul 24 18:34 .
drwxr-xr-x   4 root root 4096 Jul 24 18:32 ..
drwxrwxr-x 198 ftp  ftp   212 Mai 17  2018 filebase

So all directories up the line have read and execute permissions for everyone.

my config:

listen=YES
listen_ipv6=NO
anonymous_enable=YES
local_enable=NO
anon_root="/home/ftp/filebase/"
no_anon_password=YES
hide_ids=YES
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=NO
pasv_enable=Yes
pasv_min_port=40110
pasv_max_port=40210
ls_recurse_enable=YES
secure_chroot_dir=/var/run/vsftpd/empty

The logfile is pretty silent:

Fri Jul 24 19:16:59 2020 [pid 7822] CONNECT: Client "192.168.1.2"
Fri Jul 24 19:16:59 2020 [pid 7818] [ftp] OK LOGIN: Client "192.168.1.2", anon password "<no_password>"

Please, what am I missing?

One Answer

Ok, that's stupid.

anon_root=/home/ftp/filebase/

Without quotes, it is working. And while it's important that execute and read permissions exist to the root, there may not be write permissions. Otherwise, vsftpd throws the error

500 OOPS: vsftpd refusing to run with writable root inside chroot()

Answered by i3i5i7 on January 1, 2022

Add your own answers!

Related Questions

Action log of last ssh login

2  Asked on January 15, 2021 by andrewl64

     

Ansible loops and conditions with arrays

1  Asked on January 14, 2021 by eviltorbalan

   

DB2 Integrity Checks and Exception Tables

1  Asked on January 14, 2021 by imthefirestartr

         

MySql Can’t Start on Ubuntu 20.04 LTS

0  Asked on January 13, 2021 by john-gab-tolentino

   

Opera Mini Compression Technology

0  Asked on January 13, 2021 by myzel394

     

What does systemd “thawing” mean?

0  Asked on January 12, 2021 by johannes-ernst

 

Strongswan transport mode ipsec within subnet

1  Asked on January 12, 2021 by viraptor

     

SuperMicro Servers can’t detect ALL Disk attached to SAS

0  Asked on January 11, 2021 by sami-satti

   

Zabbix key with comma

1  Asked on January 11, 2021 by pawe-zimny

 

Zabbix doesn’t run custom alert script

1  Asked on January 11, 2021 by alfred-balle

   

SQL Server 2012 Native Client returns missing DLL error on install

1  Asked on January 10, 2021 by user306594

   

Ask a Question

Get help from others!

© 2023 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir