Score:0

how to get vsftpd anonymous upload and download working in ubuntu

de flag

I am using ubuntu 18.04. I need to set up vsftpd in so that anonymous uploads and downloads are possible (i.e logging in by typing "anonymous" as username and anything as password). I also need the anonymous root to be a specific directory. I know it's not secure, but security doesn't matter in this case. My vsftpd.conf file:

listen=YES
local_enable=YES
write_enable=YES
xferlog_file=YES

anonymous_enable=YES
anon_root=/var/www/html/Ax78klm34e4ijKSi8lnik
anon_upload_enable=YES
anon_mkdir_write_enable=YES

chown_uploads=YES
chown_username=ftp
allow_writeable_chroot=YES

These are the permissions for that directory

drwxrwxrwx 5 root    root     4096 Jun  6 11:01 ./
drwxr-xr-x 3 root    root     4096 Jun  4 10:07 ../
drwxrwxr-x 7 root    root     4096 May 27 19:34 assets/
drwxrwxrwx 2 root    root     4096 Jun  5 22:03 Ax78klm34e4ijKSi8lnik/
-rw-r--r-- 1 root    root      465 Jun  4 16:55 config.php
-rw-rw-r-- 1 root    root      883 May 27 19:34 gulpfile.js
-rw-rw-r-- 1 root    root    57676 Jun  5 14:32 index.php
-rw-rw-r-- 1 root    root     1069 May 27 19:34 LICENSE
-rw-r--r-- 1 root    root     3291 Jun  5 17:48 login.php
drwxrwxr-x 2 root    root     4096 May 27 19:34 media/
-rw-rw-r-- 1 root    root     1296 Jun  5 11:45 package.json
-rw-r--r-- 1 root    root     5307 Jun  4 23:36 register.php
-rw-r--r-- 1 root    root       31 Jun  5 14:40 robots.txt
-rw-r--r-- 1 root    root      109 Jun  5 17:43 test.php

This is the error that i'm getting

Connected to 192.168.43.57.
220 (vsFTPd 3.0.3)
Name (192.168.43.57:archangel): anonymous
331 Please specify the password.
Password:
500 OOPS: vsftpd: refusing to run with writable root inside chroot()
Login failed.
ftp> 

I tried changing the permissions of the required directory to 0755, then the above issue is resolved, but i'm unable to upload in that case.

Marc Vanhoomissen avatar
in flag
Did you enter somethinf like an email adress in the 'password' field? Also adding ` no_anon_password=YES` will prevent the system from asking a password.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.