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?
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
1 Asked on January 14, 2021 by testing-nuwani
1 Asked on January 14, 2021
1 Asked on January 14, 2021 by imthefirestartr
2 Asked on January 13, 2021 by th3monk3y
1 Asked on January 12, 2021
1 Asked on January 12, 2021 by viraptor
1 Asked on January 12, 2021 by pete
1 Asked on January 11, 2021 by mrhinsh-martin-hinshelwood
0 Asked on January 11, 2021 by server-fault
0 Asked on January 11, 2021 by sami-satti
0 Asked on January 10, 2021
1 Asked on January 10, 2021 by user306594
1 Asked on January 10, 2021 by johnklee
Get help from others!
Recent Questions
Recent Answers
© 2023 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir