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 December 9, 2021 by tyr_90
3 Asked on December 9, 2021 by tom-klino
2 Asked on December 9, 2021
1 Asked on December 9, 2021 by 0leg
3 Asked on December 9, 2021
1 Asked on December 9, 2021 by sudip
3 Asked on December 9, 2021 by chris9834
1 Asked on December 9, 2021 by tuckson
1 Asked on December 9, 2021 by mkopriva
0 Asked on December 9, 2021 by bstorm
0 Asked on December 9, 2021
1 Asked on December 7, 2021 by davewolfs
2 Asked on December 7, 2021 by chandan-singh
1 Asked on December 7, 2021
google cloud platform google kubernetes engine https kubernetes websocket
2 Asked on December 7, 2021 by dg-dm
1 Asked on December 7, 2021
Get help from others!
Recent Answers
Recent Questions
© 2023 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP