Using ftp to quickly build ftp server (revised version)

  
previously described a quick deployment method of vsftpd under linux, although it can complete the general upload and download tasks, but there is still a gap from the actual application, for example: ftp users You can use the cd command to the root directory, etc. In order to further meet the actual requirements, the previous article is further supplemented.

1, download the source code to the server, download address is ftp://vsftpd.beasts.org/users/cevans/, the current version is vsftpd-2.0.5.tar.gz. It is strongly recommended to use the source code installation to get rid of the confusion of similar rpm package dependencies, and to achieve free work under different Unix/linux.
2, decompression installation: tar zxvf vsftpd-2.0.5.tar.gz ; make; make install
3, add ftp users, if the number of users is not much, simple, use system users. Useradd –d /home/sery sery ;passwd ******.
4, copy the configuration file, there are 2 here. Cp vsftpd.conf /etc/vsftpd.conf ;cp Redhat/vsftpd.pam /etc/pam.d/ftp . Do not copy the vsftpd.pam file, which will cause ftp users to log in. This file is also available under 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 comment in front of local_enable=yes write_enable=yes and local_umask=022.
(2) Add part: listen=YES (ftp as a separate daemon)
chroot_local_user=yes (users are located in their home directory, with cd /can not switch to the root directory)

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, SYST (only upload files and directories, but not delete. Note: These must be written in one line)
6, start ftp service . Vsftpd &

Description: Profile vsftpd.conf can not have a blank line before each must be the top grid to write, otherwise fail.
Copyright © Windows knowledge All Rights Reserved