Ошибка 553 could not create file

При редактировании/сохранении файла FileZilla выдает ошибку: «553 Could not create file».

На ДО стоит дебиан-сервер. Все отлично работало до изменения php.ini, но после его редактирования (upload_max_filesize) и перезагрузки сервера ФТП перестало работать.

UPD. Конфигурация vsftpd:

anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=002
anon_upload_enable=NO
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
dual_log_enable=YES
chroot_local_user=YES
listen=YES
pam_service_name=vsftpd
userlist_enable=NO
tcp_wrappers=YES
force_dot_files=YES
ascii_upload_enable=YES
ascii_download_enable=YES
#allow_writable_chroot=YES
allow_writeable_chroot=YES
seccomp_sandbox=NO
pasv_enable=YES
pasv_max_port=12100
pasv_min_port=12000

FTP error 553 is one of the typical errors that we come across while uploading files via FTP.

This is generally caused due to the incorrect permissions set to the files. Or else the FTP clients like vsftpd do not allow any upload.

At Bobcares, we often receive requests to fix FTP errors as a part of our Server Management Services.

Today, let’s discuss this 553 error in FTP and see how our Support Engineers fix it.

What does FTP error 553 indicate?

The error 553 indicates that requested action not taken or File name not allowed.

Generally, the error 533 shows up while uploading any files in the FTP. Again various FTP clients show different variants of the error message. For instance, FTP command prompt error appears as:

ftp> put /home/user/Desktop/FTP/2.jpg
local: /home/user/Desktop/FTP/2.jpg remote: /home/user/Desktop/FTP/2.jpg
227 Entering Passive Mode (192,xx,134,131,24,92).
553 Could not create file.
ftp>

Causes for FTP error 553

Let’s now check on the major causes for 553 errors in FTP.

1. Incorrect permissions

Quite often, FTP error 553 can occur due to bad permissions set to the files and folders.

If the uploading files do not have write permissions, then it will end up with errors.

It is very essential to have the write permissions set to the files so that we can make changes to the file by uploading any contents to it. Additionally, the user should have enough privileges to write the files to the destination directory too.

2. Errors in the configuration of vsftp

This error also occurs due to incorrect configuration of FTP clients like Vsftp. In other words, any incorrect information set in the configuration file results in such errors.

For example, the value of write_enable in the vsftpd.conf must be set to true to allow writing. However, by default, it is set to false. This creates problems and ends up in 553 errors.

We normally, make sure that the FTP client configuration is set properly with the proper details.

How we fix FTP error 553?

Having a decade of expertise in server management, our Support Engineers are familiar with these FTP errors.

Let’s now discuss different scenarios where we experienced this error and how we fix it.

1. Check the permissions and ownership to fix FTP error 553

One of our customers recently created a user and was successfully connected to FTP. But, while trying to upload some contents into the account, they got an error

229 Entering Extended Passive Mode (|||12011|).
553 Could not create file.

Our Support Engineers started troubleshooting the error by checking the permissions of the file. We could see that the permissions were set right.

So, then we tried to change the ownership of the folder to which customer was trying to upload the contents using the command:

chown USER:GROUP folder_name

Finally, after this change, the customer was able to upload the contents successfully.

2. Incorrect value in the configuration file.

Recently, one of our customers approached with an error message

553 Could not create file

Our Support Engineers started troubleshooting the error by checking the permissions of the files. We found that the permissions were all set right.

Later we went checking for the configuration file vsftpd.conf.

Here, we found the below line

guest_enable=YES

If this guest_enable is set to YES, then it will throw 553 Could not create file error.

So, we set the guest_enable value to NO.

This is because the FTP server will consider all the logins as a guest login. As a result, it will end up throwing error messages.

Finally, this fixed the error after changing the value of guest_enable from YES to NO.

[Still experiencing errors with FTP? – We’ll help you]

Conclusion

In short, the FTP error 553 occurs mainly due to the improper permissions set to the file and due to the incorrect details in the FTP client configuration. Today, we saw how our Support Engineers fix this error.

nano /etc/vsftpd.conf

# modify these lines
write_enable=YES
chroot_local_user=YES

# add these lines
userlist_enable=YES
userlist_file=/etc/vsftpd.userlist

add the user to /etc/vsftpd.userlist

usermod --home /var/www/html/ username
chown -R username /var/www/html
chmod -R 755 /var/www/html

7 is user, 5 is group, 5 is other

7 is binary 111, 5 is binary 101

111 = read (yes), write (yes), execute (yes)

101 = read (yes), write (no), execute (yes)

So, the user can read, write, execute but other people can’t write.

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

qbi's user avatar

qbi

18.8k9 gold badges78 silver badges127 bronze badges

asked Feb 19, 2013 at 6:58

Aram Boyajyan's user avatar

3

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

gertvdijk's user avatar

gertvdijk

66.6k33 gold badges186 silver badges282 bronze badges

answered Jul 15, 2013 at 6:28

Amin Y's user avatar

Amin YAmin Y

3063 silver badges4 bronze badges

0

I found I had set the correct ownership, but not the correct permissions.


If your folder is owned by the user ‘ftpuser’ and group ‘www-data’ for example, like…

drwxr-sr-x 3 ftpuser www-data 4096

Then you probably haven’t run…

sudo chmod -R g+w /var/www/ftpuserfolder

Which gives write permission to the group that owns those files/folders.

answered Apr 12, 2018 at 12:33

Crimbo's user avatar

CrimboCrimbo

5791 gold badge5 silver badges14 bronze badges

For me nothing worked. I figured out that the initial directory in my FTP Client was set to nothing, so it tried to access the linux root directory. I was letting it empty first, because I thought it will pick the users home directory.

I had to specify the full path to the project.

answered Sep 1, 2021 at 14:35

Black's user avatar

BlackBlack

7641 gold badge7 silver badges16 bronze badges

Настроил на сервере ftp с помощью vsftpd. Конфиг следующий:

listen=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
xferlog_file=/var/log/vsftpd.log
xferlog_std_format=YES
connect_from_port_20=YES
idle_session_timeout=600
data_connection_timeout=60
ftpd_banner=###FTP###
allow_writeable_chroot=YES
chroot_local_user=YES
ascii_upload_enable=YES
ls_recurse_enable=YES
max_clients=20
secure_chroot_dir=/var/run/vsftpd
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

Права на папку есть у локального пользователя, от которого присоединяюсь к ftp

drwxr-xr-x  2 maxftp maxftp 4.0K Mar 24 22:14 ftp

Коннект проходит

ftp <myip>
Connected to <myip>
220 Welcome to ftpd!
Name (): maxftp
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> 

Однако, при попытке записать файл получаю ошибку или таймаут

ftp> put Downloads/about 
local: Downloads/about remote: Downloads/about
200 PORT command successful. Consider using PASV.
553 Could not create file.

так получаю таймаут

curl -T Downloads/about ftp://<myip> --user <myuser>

что не учитываю или где допускаю ошибку?

Понравилась статья? Поделить с друзьями:
  • Ошибка 552 что это такое
  • Ошибка 5503 мерседес w164 пневмоподвески
  • Ошибка 552 что это значит
  • Ошибка 5502 мерседес ml w164
  • Ошибка 552 при отправке почты