Ubuntu Configuring an FTP server with VSFTPD

Source: Internet
Author: User

Install FTP

sudo apt-get install vsftpd

Configure vsftpd.conf

sudo nano/etc/vsftpd.conf
#禁止匿名访问anonymous_enable =no# Accept local user local_enable=yes# allow upload write_enable=yes# user can only access restricted directory chroot_local_user=yes# set fixed directory , added at the end. If you do not add this line, each user corresponding to their own directory, of course, this folder built Local_root=/home/ftp

Look at the online said add a line "pam_service_name=vsftpd", I think I this configuration file is already there, no matter.

Add FTP User

sudo useradd-d/home/ftp-m ftpusersudo passwd ftpuser

Adjust folder permissions

This is to avoid "OOPS:vsftpd:refusing to run with writable root inside Chroot ()"

sudo chmod a-w/home/ftpsudo mkdir/home/ftp/data

This will see the Data folder after login, although a little trouble, the reason is not table. It's hard to find information so bitter.

Change PAM.D/VSFTPD

This time directly with Useradd account login FTP will 530 login incorrect

sudo nano/etc/pam.d/vsftpd

Comment out

#auth    Required Pam_shells.so

Restart VSFTPD

sudo service vsftpd restart

At this point you can use the Ftpuser just built this user login FTP, see is Local_root set/home/ftp, and limited in the directory.

can be accessed in the browser with FTP://XXX.XXX.XXX.XXX, also can use FTP software such as FLASHFXP, password is ftpuser password.

About User Access folder restrictions

By the Chroot_local_user, chroot_list_enable, chroot_list_file These three documents control, to transfer someone's passage:

First of all, chroot_list_enable good understanding, is: whether to enable Chroot_list_file configuration of the file, if yes indicates that the Chroot_list_file configuration of the file to take effect, otherwise does not take effect;
Second, Chroot_list_file is also simple, configure a file path, the default is/etc/vsftpd.chroot_list, the file will be filled with some account names. However, the meaning of these accounts is not fixed and is related to the configuration item Chroot_local_user. Described in the following article;
Third, Chroot_local_user for yes means that all users * cannot * switch to a directory other than the home directory, but! The user is listed in addition to the Chroot_list_file configuration file. Chroot_local_user for no means that all users can * switch to a directory other than the home directory, but! The user is listed in addition to the Chroot_list_file configuration file. It can also be understood that chroot_list_file lists the "exceptions" to the user.

"Failed to connect in PASV mode" prompt when client logs in

Edit/etc/vsftpd.conf

Last Added

Pasv_promiscuous=yes

Then restart the VSFTPD service.

Ubuntu Configuring an FTP server with VSFTPD

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.