How to set up an anonymous user without a password in vsftpd

Hi, I have installed vsftpd-tls version 3.0.5-2 on openwrt 23.05
and root login is working properly. I want to access a specified path anonymously and without a password. However, I have trying configuring it, but I was unsuccessful as it prompted me for a password for both ftp and anonymous users and didn't allow me to login. could you help me?

This is my /etc/vsftpd.conf file:

background=YES
listen=YES
listen_port=21
anonymous_enable=YES
no_anon_password=YES
anon_root=/mnt/ftp # chown ftp:ftp & chmod 775 
anon_mkdir_write_enable=NO
anon_upload_enable=NO
anon_world_readable_only=YES
ftp_username=ftp
local_enable=YES
write_enable=YES
local_umask=022
check_shell=NO
#dirmessage_enable=YES
#ftpd_banner=Welcome to blah FTP service.
session_support=NO
#syslog_enable=YES
userlist_enable=YES
userlist_deny=NO
userlist_file=/etc/vsftpd/vsftpd.users
log_ftp_protocol=YES
vsftpd_log_file=/var/log/vsftpd.log
xferlog_enable=YES
xferlog_std_format=YES
xferlog_file=/var/log/xferlog.log

###
### TLS/SSL options
### example key generation: openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/vsftpd/vsftpd_privkey.pem -out /etc/vsftpd/vsftpd_cert.pem -subj /C="DE"/ST="Saxony"/L="Leipzig"/CN="OpenWrt"
#ssl_enable=YES
#allow_anon_ssl=NO
#force_local_data_ssl=NO
#force_local_logins_ssl=NO
#ssl_tlsv1=YES
#ssl_sslv2=NO
#ssl_sslv3=NO
#rsa_cert_file=/etc/vsftpd/vsftpd_cert.pem
#rsa_private_key_file=/etc/vsftpd/vsftpd_privkey.pem

The settings for anonymous posted in Anonymous vsftpd uploads not working? work.

1 Like

My issue was incorrect "permission".
The anonymous/ftp user (ftp_username=ftp) should not have write access to anon folder (anon_root=/mnt/ftp) but they should have write access to its contents. So, in this case, the anonymous/ftp user has rx permissions for /mnt/ftp and rwx permissipns for the contents of /mnt/ftp.

This is my final config:

background=YES
listen=YES

write_enable=YES
local_umask=022
check_shell=NO

# it must exist as system local user
ftp_username=ftp
anonymous_enable=YES
anon_root=/mnt/usb/share/stages
anon_upload_enable=NO
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
no_anon_password=YES
session_support=NO

local_enable=YES
userlist_enable=YES
userlist_deny=NO
userlist_file=/etc/vsftpd.users

And this is vsftp.users:

root
ftp
anonymous

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.