Ubuntu FTP Server

Source: Internet
Author: User

Small work for a period of time, found that although the online about this aspect has a lot of related tutorials, or is too simple, for small white students can not understand, or is very "high-end", the whole

For individuals, not commonly used or even a lifetime of things, so comprehensive online stickers and other resources, their own after trying to install debugging, finishing a tutorial below.

Since then, the small white classmate will no longer for Ubuntu under the VSFTPD install FTP server and worry! (PS: This is the simplest, best use of the tutorial; starting point: It's good to use)

This document is tested in Ubuntu Server 14.04 AMD64 System.

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.

sudo service vsftpd restart

If there is an error in using the process. And error is 553 could not create file first creates a directory in the FTP directory, and then sets the permission to 777
$ sudo mkdir/var/ftp/write
$sudo Chmod-r 777/var/ftp/write
Then modify the vsftp configuration file/etc/vsftpd.conf file
At the end add
Local_root=/var/ftp
Save, then kill the VSFTPD process, and then restart the VSFTPD server program.
Try, upload the file to the write directory, this time can be normally uploaded files.

Ubuntu FTP Server

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.