Use vsftp to quickly build an ftp server (revision)
Source: Internet
Author: User
Use vsftp to quickly set up an ftp server (revision)-Linux Enterprise Application-Linux server application information. The following is a detailed description. Author: Tian Yi (sery@163.com)
The preceding describes a Fast deployment method of vsftpd in linux. Although it can complete normal upload and download tasks, there is still a gap from the actual application. For example: for example, ftp users can use the cd command to go to the root directory. In order to further meet the actual requirements, we have made further additions to the previous article.
1. Download the source code to the server, which is ftp://vsftpd.beasts.org/users/cevans/. the previous example is vsftpd-2.0.6.tar.gz. We strongly recommend that you use the source code for installation to get rid of the confusions similar to rpm package dependencies and work freely in different unix/linux environments.
2, unzip the installation: tar zxvf vsftpd-2.0.5.tar.gz; make install
3. Add ftp users. If there are not many users, simply use the system users. Useradd? D/home/sery; passwd ******.
4. Copy the configuration file. Here there are two. Cp vsftpd. conf/etc/vsftpd. conf; cp Redhat/vsftpd. pam/etc/pam. d/ftp. do not copy vsftpd. the pam file will cause ftp users to be unable to log on. This file is also available in debian.
5. modify the configuration file/etc/vsftpd. conf. This configuration file is the key to vsftpd. Modify the following values to implement different functions:
(1) modified part: cancel the comments before local_enable = yes write_enable = yes and local_umask = 022.
(2) added: listen = YES (ftp acts as an independent Daemon)
Chroot_local_user = yes (the user is located in his/her home directory and cannot switch to the root directory using cd)
Cmds_allowed = ABOR, CWD, LIST, MDTM, MKD, NLST, PASS, PASV,
PORT, PWD, QUIT, RETR, RMD, RNFR, RNTO, SITE, SIZE, STOR, TYPE, USER,
ACCT, APPE, CDUP, HELP, MODE, NOOP, REIN, STAT, STOU, STRU, and SYST (only files and directories can be uploaded, but cannot be deleted. Note: these must be written in one row)
6. Start the ftp service. Vsftpd &
After installation is complete, I cannot run:
The following error is reported:
500 00 PS: cocould not bind listening IPv4 socket
A port conflict exists. View:
# Netstat-utl | whether grep 21 is occupied
Yes. Because it was redhat9, we thought of xinetd.
Because xinetd has started vsftpd and vsftpd is set to stardalone mode, stop the xinetd service and service xinetd stop first, and then:/usr/local/sbin/vsftpd &
OK.
Modify the Port:
Add the following at the end of vsftpd. conf:
Listen_port= 2121
Cancel anonymous Logon
Anonymous_enable = NO
As mentioned in the boss's original article, to prevent users from switching to other directories, you need to add a file:
Vim/etc/vsftpd/chroot_list Add the user you want to limit
Vsftpd. conf also removes the corresponding comment: chroot_list_file =/etc/vsftpd/chroot_list
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