File Server II: FTP Server (PUREFTP)

Source: Internet
Author: User
Tags file transfer protocol ftp protocol

FTP (file Transfer Protocol), which is used primarily for file transfer (especially handy for transferring large files), is used for two-way transmission of control files on the Internet. This service allows users to access a large number of programs and information on the server by connecting their PC to all servers running the FTP protocol around the world.


The primary role of FTP is to have users connect to a remote computer (the FTP service is running on the remote computer), to see which files are on that computer, to copy the required files from the remote computer locally, or to transfer the local files to the remote computer. However, there is a certain risk in the transmission process, because the data above the Internet is completely unprotected clear text transmission mode.


The FTP software that comes with CentOS or RedHat Linux is called vsftp, but here is a second software (PURE-FTPD) that provides the FTP service. This software is more flexible than the vsftp configuration.



Let's take a look at the deployment and optimization process of pureftp, where we use the source package to compile the installation method:


1, download the source package: PURE-FTPD's official website is: HTTP://WWW.PUREFTPD.ORG/PROJECT/PURE-FTPD

We can go to the website to download the version we need.


Cd/usr/local/src


wget wget https://download.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-1.0.42.tar.bz2

2. Installation steps:


Tar xjvf pure-ftpd-1.0.42.tar.bz2


CD pure-ftpd-1.0.42


./configure \


--PREFIX=/USR/LOCAL/PUREFTPD \


--WITHOUT-INETD \


--with-altlog \


--with-puredb \


--with-throttling \


--with-peruserlimits \


--with-tls


Note: We may encounter errors here, after compiling the system will prompt: Configure:error:OpenSSL headers not found.


The workaround is: Yum install-y OpenSSL openssl-devel, if you cannot find both packages, you will need to install the Yum extension Source: Yum Install-y epel-release


Make && make install


3, Configuration pure-ftpd


CD Configuration-file


Mkdir-p/usr/local/pureftpd/etc/


CP pure-ftpd.conf/usr/local/pureftpd/etc/pure-ftpd.conf


CP pure-config.pl/usr/local/pureftpd/sbin/pure-config.pl


chmod 755/usr/local/pureftpd/sbin/pure-config.pl


Before starting PURE-FTPD, you need to modify the configuration file, configuration file for/usr/local/pureftpd/etc/pure-ftpd.conf, you can open to see, there are a lot of content, the following is the author provides the configuration file content, If you feel that the direct change is too troublesome, directly bring your own configuration to remove, and then paste the following configuration can be


Chrooteveryone Yes


Brokenclientscompatibility No


Maxclientsnumber 50


Daemonize Yes


Maxclientsperip 8


Verboselog No


Displaydotfiles Yes


AnonymousOnly No


Noanonymous No


Syslogfacility FTP


Dontresolve Yes


MaxIdleTime 15


Puredb/usr/local/pureftpd/etc/pureftpd.pdb


Limitrecursion 3136 8


Anonymouscancreatedirs No


Maxload 4


Antiwarez Yes


Umask 133:022


Minuid 100


ALLOWUSERFXP No


ALLOWANONYMOUSFXP No


Prohibitdotfileswrite No


Prohibitdotfilesread No


Autorename No


Anonymouscantupload No


Pidfile/usr/local/pureftpd/var/run/pure-ftpd.pid


Maxdiskusage 99


Customerproof Yes


4. Start PURE-FTPD


cd/usr/local/pureftpd/


./sbin/pure-config.pl./etc/pure-ftpd.conf


If it is successful, it displays a long line of information that starts with Running, or it is an error message. Restarting may be a bit cumbersome, after all, we don't have a startup script. Restart, you can use the following command to implement.


Killall PUREF-FTPD


cd/usr/local/pureftpd/;/sbin/pure-config.pl./etc/pure-ftpd.conf


5. Create an Account


The account used by PURE-FTPD is not a Linux system account, but a virtual account. Because it's safer to do so.


mkdir/data/www/


Useradd FTP


Chown-r ftp:ftp/data/www/


/USR/LOCAL/PUREFTPD/BIN/PURE-PW Useradd ftp_user1-uftp-d/data/www/


Password:


Enter It again:


Where-u associates the virtual user Ftp_user1 with the system user www, that is to say, using ftp_user1
Once the account is logged in to FTP, it will read the file or download it as www. -D behind the directory is Ftp_user1 account
Home directory so that Ftp_user1 can only access its home directory/data/www/. It's not done yet.
The key step is to create a user information database file:


/USR/LOCAL/PUREFTPD/BIN/PURE-PW MKDB


PURE-PW can also list the current FTP account, of course, you can delete an account, we create an account:


/USR/LOCAL/PUREFTPD/BIN/PURE-PW useradd ftp_user2-uwww-d/tmp


/USR/LOCAL/PUREFTPD/BIN/PURE-PW MKDB


Note: Each time you create an account, execute this command, generate a database file, or you will get an error.


List Current Account:


/USR/LOCAL/PUREFTPD/BIN/PURE-PW List


The command to delete the account is:


/USR/LOCAL/PUREFTPD/BIN/PURE-PW Userdel Ftp_user2



6. Testing


Download Lftp:yum install-y lftp on the remote machine


Connect FTP Service Using remote machine: lftp [email protected]





This article is from "The Miracle Teenager" blog, please be sure to keep this source http://raffaelexr.blog.51cto.com/8555551/1723325

File Server Two: FTP server (PUREFTP)

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.