In ubuntu, vsftp cannot upload files.

Source: Internet
Author: User

It has been nearly four months since I started using Ubuntu, and I have been familiar with this OS. From the beginning of FTP installation to the present, there have been problems with uploading files, and it has not been solved. Today, I really don't want to pull out the hard disk. I copied it in a box and simply solved this problem.

I always thought it was the reason for the configuration. Today I finally solved it. The vsftp configuration file is in the/etc/vsftpd. conf directory.

First, let's talk about the upload problems.

1. Upload a log file to/home/ftp

$ Wput log ftp: // 172.16.55.47

Connecting to 172.16.55.47: 21... connected!

Logging in as anonymous... logged in!
Send failed (cocould not create file.) skipping this file
Finished -- 10:52:18 --

I found the information on the Internet and said that I didn't have the write permission. So I changed the FTP directory to the write permission, that is, $ sudo chmod 777/home/FTP, and then continued to upload the file.

$ Wput log ftp: // 172.16.55.47

Connecting to 172.16.55.47: 21... connected!

Logging in as anonymous... error: Login-sequence failed (Oops: vsftpd: refusing to run with writable Anonymous root)
Skipping all files from this account...
Finished -- 10:34:03 --
Transmission of 1 file failed.

The error reported this time is that anonymous logon with write permission is denied. The specific reason is that the root directory/home/FTP of vsftpd has the following permissions: drwxrwxrwx is completely unrestricted (maybe chmod 777/home/FTP is accidentally executed); but vsftpd does not allow unlimited/home/FTP for security reasons, this causes the above errors. That is to say, my permissions here are too wide.

Now, no permission is given. It says that there is no write permission, and the write permission is given and the permission is given too much. It means that it is useless to modify only these permissions. So check whether the configuration is faulty.

$ Sudo vi
/Etc/vsftpd. conf

The added options include:

Listen = Yes

Anonymous_enable = Yes

Local_enable = Yes

Write_enable = Yes

Anon_upload_enable = Yes

Anon_mkdir_write_enable = Yes

Dirmessage_enable = Yes

Use_localtime = Yes

Xferlog_enable = Yes

Connect_from_port_20 = Yes

Chown_uploads = Yes


Chown_username = whoever


Chroot_local_user = Yes

Secure_chroot_dir =/var/run/vsftpd/empty

Pam_service_name = vsftpd

Rsa_cert_file =/etc/SSL/private/vsftpd. pem

The red part is added.

Next,

$ CD/home/ftp
$ Sudo mkdir opendir
$ Sudo chmod 777 opendir/

Then upload the log file, for example:

# Wput log ftp: // 172.16.55.47/opendir/

It must be noted that the opendir here is a directory, so remember to include it in the/section next to it. Otherwise, an error will occur!

If it is a technical problem, Google

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.