In Linux, the FTP prompt-553 cocould not create file (absolutely useful)

Source: Internet
Author: User

 

Tip 553 cocould not create file: Set the owner and permissions of the Directory, or report this error. Check it online carefully. The problem is solved as follows:
 
Error Message
 
The current directory is/home.
Ftp>! Ls-l
......
-Rwxr-XR-x 1 Root 146 Aug 16 hosts
-RW-r -- 1 Root 46 Aug 16 host.txt
-RW-r -- 1 Root 51 Aug 15 07:14 logins.txt
.....
Ftp> put host.txt
Local: host.txt remote: host.txt
227 entering passive mode (62,184, 0)
150 OK to send data.
226 file receive OK.
46 bytes sent in 0.014 seconds (3.2 Kbytes/s)
Ftp> put hosts
Local: hosts remote: hosts
227 entering passive mode)
150 OK to send data.
226 file receive OK.
146 bytes sent in 0.046 seconds (3.1 Kbytes/s)
Ftp> put/home/hosts
Local:/home/hosts remote:/home/hosts
227 entering passive mode)
553 cocould not create file.
Ftp>
Problem: ftp> put/home/hosts and ftp> put hosts (the current directory is/home
) The execution parameters should be the same. Why can't the previous one be uploaded?
 
To solve this problem, we must first analyze the cause, as shown in
 
1. Check if SELinux is disabled.
2. Maybe the FTP Folder does not have the write permission. Check the directory permission.
3. Is there write_enable = yes in the configuration file?
 
First try:
 

The Code is as follows:

Copy code

 

 
1. setsebool-P ftpd_disable_trans 1
2. Service vsftpd restart
 

If the problem is solved, do not look down. Otherwise, you can look down to another method.
 
We need to set allow_ftpd_full_access to 1.
 

The Code is as follows:

Copy code

 

 
[Root @ umboyserver vsftpd] # setsebool allow_ftpd_full_access 1
 
[Root @ umboyserver vsftpd] # setsebool allow_ftpd_use_cifs 1
[Root @ umboyserver vsftpd] # setsebool allow_ftpd_use_nfs 1
[Root @ umboyserver vsftpd] # setsebool ftp_home_dir 1
[Root @ umboyserver vsftpd] # setsebool httpd_enable_ftp_server 1
[Root @ umboyserver vsftpd] # setsebool tftp_anon_write 1
[Root @ umboyserver vsftpd] # service vsftpd restart
Shutting down vsftpd: [OK]
Starting vsftpd For vsftpd: [OK]
[Root @ umboyserver vsftpd] # getsebool-A | grep FTP
Allow_ftpd_anon_write --> off
Allow_ftpd_full_access --> on
Allow_ftpd_use_cifs --> on
Allow_ftpd_use_nfs --> on
Ftp_home_dir --> on
Httpd_enable_ftp_server --> on
Tftp_anon_write --> on
 

Continued:
 
Add new ftp users
 

The Code is as follows:

Copy code

 

Useradd FTP-New-S/sbin/nologin-g ftp-D/home/ftp-New
Modify system configuration iptables
/Etc/sysconfig/iptables
/Etc/init. d/iptables restart

 

An anonymous user is recommended.
 
1. In the vsftpd. conf file:
 

The Code is as follows:

Copy code

 

 
Write_enable = Yes
 
Anon_mkdir_write_enable = Yes
 
Anon_other_write_enable = Yes
 

2. FTP directory permissions:
 
View the FTP directory:
 

The Code is as follows:

Copy code

 

 
> CAT/etc/passwd | grep FTP
 
FTP: X: 107: 65534:/home/ftp:/bin/false
 

The FTP directory is/home/FTP.
 

The Code is as follows:

Copy code

 

 
Chown root: Root/home/ftp
 
Chmod-r 755/home/ftp
 

However, files cannot be uploaded. Because this is an anonymous user, the current directory owner is a root user. You really need to upload a file and create a folder under this directory. For example, if the name is upload,
 

The Code is as follows:

Copy code

 

 
Mkdir/home/FTP/upload
 
Chown ftp: Root/home/FTP/upload
 

At this time, you can upload files to the upload directory, but the root directory still cannot upload files. This is an anonymous user. If it is an anonymous user, this problem does not exist.

For more details, see: http://www.111cn.net/sys/linux/45542.htm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.