2

Have set up an FTP server and user. but it seems I'm unable to upload or edit any file.

Even though the user has filled 777 permission. I can't even upload files to the user's root folder.

Server OS: Ubuntu

Client OS windows

FTP server/ Client: fileZila

Log:

Status: Connection established, waiting for welcome message...
Status: Insecure server, it does not support FTP over TLS.
Status: Server does not support non-ASCII characters.
Status: Logged in
Status: Starting download of /var/www/html/wp/staged/wp-content/themes/Newspaper/Newspaper/woocommerce/single-product.php
Status: File transfer successful, transferred 1,193 bytes in 1 second
Status: Starting download of /var/www/html/wp/staged/wp-content/themes/Newspaper/Newspaper/woocommerce/single-product.php
Status: File transfer successful, transferred 1,193 bytes in 1 second
Status: Starting upload of C:\Users\User\AppData\Local\Temp\fz3temp-2\single-product.php
Command:    PASV
Response:   227 Entering Passive Mode (165,227,173,119,117,244).
Command:    STOR single-product.php
Response:   550 Permission denied.
Error:  Critical file transfer error

File permission:

File permission

Groups and users:

Groups and users

vsftpd.conf:

# Standalone mode
listen=YES
max_clients=200
max_per_ip=4
# Access rights
anonymous_enable=YES
local_enable=NO
write_enable=YES
anon_upload_enable=YES
anon_mkdir_write_enable=NO
anon_other_write_enable=NO
# Security
anon_world_readable_only=NO
connect_from_port_20=YES
hide_ids=YES
pasv_min_port=50000
pasv_max_port=60000
# Features
xferlog_enable=YES
ls_recurse_enable=NO
ascii_download_enable=NO
async_abor_enable=YES
# Performance
one_process_model=YES
idle_session_timeout=120
data_connection_timeout=300
accept_timeout=60
connect_timeout=60
anon_max_rate=50000
anon_mkdir_write_enable=NO
anon_other_write_enable=NO

#Userlist

userlist_deny=NO
userlist_enable=YES
userlist_file=/etc/vsftpd.allowed_users

vsftpd.allowed_users:

ftpuser

Any idea what's going on here?

Update: I have changed the permission of the folder that holds the file to 777, and it still doesn't work.

parent folder permission

log:

Status: Logged in
Status: Starting download of /var/www/html/wp/staged/wp-content/themes/Newspaper/Newspaper/woocommerce/single-product.php
Status: File transfer successful, transferred 1,193 bytes in 1 second
Status: Starting upload of C:\Users\User\AppData\Local\Temp\fz3temp-2\single-product.php
Command:    PASV
Response:   227 Entering Passive Mode (*xxxxxxxxxxxx*).
Command:    STOR single-product.php
Response:   550 Permission denied.
Error:  Critical file transfer error
Status: Retrieving directory listing of "/var/www/html/wp/staged/wp-content/themes/Newspaper/Newspaper"...
Status: Directory listing of "/var/www/html/wp/staged/wp-content/themes/Newspaper/Newspaper" successful
Status: Disconnected from server
Status: Connection closed by server
2
  • Check the file permissions on the folder that holds the file. Apr 3, 2020 at 14:44
  • Thanks. I have tried it, but it's still not working. I have edited to post with the log. Any other idea?
    – yoni349
    Apr 4, 2020 at 14:41

2 Answers 2

2

Your server seems to have been wide open. You had

anonymous_enable=YES
local_enable=NO

so anyone could connect to the FTP server with no real password check using usernames ftp or anonymous, and access any files or directories the user account configured with ftp_username (not specified, defaults to ftp) could. Such anonymous logins are also more tightly controlled than regular password-authenticated ones.

The upload may have failed because vsftpd might not allow anonymous users to overwrite existing files: I think you would have had to explicitly delete or rename the old file before uploading a new one in its place as an anonymous user. But because you had

anon_other_write_enable=NO

it would have not allowed you to do that.

If you are using a FTP server to allow website maintenance, you'll most definitely want to set anonymous_enable to NO and local_enable to YES, in order to disallow unauthenticated access, or else anyone with a FTP client could easily deface your site.

(And authentication without encryption is so last millennium: you would want to set up FTP over TLS unless you allow FTP access from secure private networks only!)

1

I have uninstalled vsftpd using:

sudo apt-get purge vsfpt

Then configured it using this simple guide: How To Set Up vsftpd

I still don't know what was the issue, but it works now.

2
  • 2
    For me I didn't have to do anything other than install vsftpd, uncomment to set write_enable=YES and (don't forget!) restart vsftpd (sudo systemctl restart vsftpd) (Debian 10).
    – bossi
    Dec 5, 2020 at 5:55
  • Same here, write_enable=YES, and restart server.
    – Minsky
    Jul 4, 2021 at 9:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .