FTP configuration in Ubuntu

Source: Internet
Author: User
Tags ftp access

Configuration of FTP service in Ubuntu

 

If you want to upload and download files through FTP between Windows 7 and Ubuntu on the virtual machine, filezilla is used in windows. This tool must support FTP services.

1. Install vsftpd

Sudo apt-Get install vsftpd

In this case, the system automatically creates an FTP user and an FTP group, and creates a/srv/FTP folder as the Home Directory of the FTP user. (If you want to put the FTP directory in/home/FTP, you can modify the FTP user's home directory location in the/etc/passwd file. Note:

You cannot set the permission of the FTP directory to 777, instead

Sudo chmod 755 FTP
Otherwise, you cannot log on. To upload a file, you need to create a directory under the FTP directory, set the permission to 777, and then restart the TFP service to upload something to the directory you just created)

 

2. Configure vsftpd

Run sudo/etc/vsftpd. conf.

Change anonymous_enable = No to anonymous_enable = yes to allow anonymous access.

 

3. Now you can access FTP. Test it first:

1) create a new file a.txt under the/srv/ftpdirectory, and then sudo chown root: ftp a.txt
Change the owner of a.txt to the root user in the FTP group.

2) FTP localhost
Or the IP address of the FTP host.

Failed to log on. (solution: Add the following sentence to/etc/shells:/bin/false.
Now you can log on normally. Because when we view

Sudo VI/etc/passwd
When the user name is FTP, the last line is

/Home/FTP indicates the Home Directory of FTP

/Bin/false
Shell used by FTP

 

4. If you need to set the ftp access permission, you can modify the/etc/vsftpd. conf file. The following statements are commonly used:

Write_enable = yes # Allow upload

Anon_upload_enable = yes # Allow Anonymous uploads

Anon_mkdir_write_enable = yes # Allow anonymous users to create folders

5. Restart the FTP service.

Sudo/etc/init. d/vsftpd restart

 

Start ftp: sudo/etc/init. d/vsftpd start

Disable ftp: sudo/etc/init. d/vsftpd stop

Restart ftp: sudo/etc/init. d/vsftpd restart

 

Some other problems:

500 Oops: vsftpd: refusing to run with writable Anonymous root

Check network connectivity. Ping the Linux IP address.

Confirm that the user password is correct

SSH verification or Linux Telnet service enabled?

 

For the root directory/home/FTP of vsftpd
Its permission is: drwxrwxrwx, which means there is no limit at all (maybe the CHMOD 777/home/FTP is accidentally executed );

However, vsftpd does not allow/home/FTP for security reasons, which leads to the above error.

Therefore, we only need to make the following changes:

Sudo chown root: Root/home/ftp

Sudo chmod 755/home/ftp

(If you do not Log On As A root user, you may need to add sudo before. Do not forget)

Other explanations:

 

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.