Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
19
rated 0 times [  19] [ 0]  / answers: 1 / hits: 89285  / 1 Year ago, fri, february 10, 2023, 4:40:01

Fresh LAMP server setup with Ubuntu 12.04 and VSFTPD.



I'm trying to access the /var/www folder (web root) with FTP user.



I created a new user ftpuser and added it to the www-data user group created automatically by Apache.

Home directory of that user is set to /var/www.
I also changed the ownership of the /var/www to www-data group and changed permissions to 02775.



However, I'm still not able to upload files. Error is: "553 Could not create file".




  1. Can someone please explain me how to set these permissions properly?

  2. What is the correct setup? Should I set the home directory of ftpuser to /var/www or somehow diffeerently?



I found a lot of topics on the web but none of them offer a universal solution.



Thank you!






UPDATE:



Here is the output of ls -l of /var/www:



drwxr-sr-x 3 root ftpuser 4096



Content of vsftpd.conf file:



listen=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
chown_uploads=YES
chown_username=ftpuser
chroot_local_user=YES
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key

More From » 12.04

 Answers
2

The problem is because your folder is owned by root, instead of ftpuser.



To fix it run:



sudo chown -R ftpuser:nogroup /var/www/ftuuserfolder

[#32615] Sunday, February 12, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
bblerest

Total Points: 240
Total Questions: 119
Total Answers: 113

Location: Wallis and Futuna
Member since Mon, May 18, 2020
4 Years ago
bblerest questions
Sun, Apr 16, 23, 13:50, 1 Year ago
Fri, Nov 4, 22, 06:21, 2 Years ago
Tue, Sep 27, 22, 12:22, 2 Years ago
;