FTP installation and configuration under Linux

Source: Internet
Author: User
Tags bz2 ftp file file permissions

Pure-ftpd

cd/usr/local/src/

wget http://download.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-1.0.42.tar.bz2 (Download pureftp source package)

Tar jxvf pure-ftpd-1.0.42.tar.bz2 (unzip)

CD pure-ftpd-1.0.42

./configure--prefix=/usr/local/pureftpd--without-inetd--with-altlog--with-puredb--with-throttling-- With-peruserlimits--with-tls (compiled according to this compilation parameter)

Make && make install

Mkdir-p/usr/local/pureftpd/etc/(Create a pure Profile Storage location folder)

CD Configuration-file (move to profile template location)

CP pure-ftpd.conf/usr/local/pureftpd/etc/pure-ftpd.conf (Copy profile template)

CP pure-config.pl/usr/local/pureftpd/sbin/pure-config.pl (copy boot file)

chmod 755/usr/local/pureftpd/sbin/pure-config.pl (change startup file permissions)

vim/usr/local/pureftpd/etc/pure-ftpd.conf (edit config file, as below)

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

MKDIR/DATA/FTP (Create FPT shared directory)

Useradd ftpuser (add FTP user)

Chown-r ftpuser:ftpuser/data/ftp (Change the FTP shared folder to the main group to the user you just created)

/USR/LOCAL/PUREFTPD/BIN/PURE-PW useradd user-uftpuser-d/data/ftp/(add pureftp user)

/USR/LOCAL/PUREFTPD/BIN/PURE-PW MKDB (Create user information data file)

/USR/LOCAL/PUREFTPD/BIN/PURE-PW List (lists the currently shared folders and FTP users)

/USR/LOCAL/PUREFTPD/BIN/PURE-PW Userdel User (delete users)

Yum install-y lftp (requires installation of lftp)

LFTP [email protected] (connection pureftp)

Get 1.txt (Download)

Put 2.txt (upload)

Vsftp

Yum install-y lftp (Installation vsftp)

/ETC/INIT.D/VSFTPD Start (open vsftp service, if it fails, it is possible that the port is occupied)

vim/etc/vsftpd/vsftpd.conf (Modify the Vsftp configuration file, remove the Red line comment)

# Specify an explicit list of the Local users to Chroot () to their home

# directory. If Chroot_local_user is YES and then this list becomes a list of

# users to not Chroot ().

Chroot_local_user=yes

#chroot_list_enable =yes (whether to open the Access user table)

# (default follows)

#chroot_list_file =/etc/vsftpd/chroot_list (Access user table storage location)

LFTP [email protected] (Remote access FTP server)

Configuring VSFTP Virtual User Services

Vim/etc/vsftpd/vsftpd_login (Create virtual user login information)

Tset1

aaa111222

chmod 600/etc/vsftpd/vsftpd_login (Change login information file permissions)

Db_load-t-T Hash-f/etc/vsftpd/vsftpd_login/etc/vsftpd/vsftpd_login.db (generates the library file corresponding to the login information)

mkdir/etc/vsftpd/vsftpd_user_conf/(Create virtual user profile directory)

Cd/etc/vsftpd/vsftpd_user_conf (move to this directory)

Vim test1 (Edit the configuration file for virtual user test1)

Cal_root=/home/virftp/test1

Anonymous_enable=no

Write_enable=yes

local_umask=022

Anon_upload_enable=no

Anon_mkdir_write_enable=no

idle_session_timeout=600

data_connection_timeout=120

max_clients=10

Max_per_ip=5

local_max_rate=50000

Mkdir/home/virftp/test1 (Create ftp file upload directory)

Chown-r virftp:virftp/home/virftp (change the host and group of FTP directories)

VIM/ETC/PAM.D/VSFTPD (Change the configuration file, add the following two lines, if it is a 64-bit system you need to change to/lib64/: )

Auth sufficient/lib/security/pam_userdb.so db=/etc/vsftpd/vsftpd_login

Account Sufficient/lib/security/pam_userdb.so Db=/etc/vsftpd/vsftpd_login

vim/etc/vsftpd/vsftpd.conf (Edit the master profile, close the configuration below and add a red configuration)

Anonymous_enable=no

Anon_upload_enable=no

Anon_mkdir_write_enable=no

Chroot_local_user=yes

Guest_enable=yes

Guest_username=virftp

Virtual_use_local_privs=yes

User_config_dir=/etc/vsftpd/vsftpd_user_conf

/ETC/INIT.D/VSFTPD Restart (restart effective)


FTP installation and configuration under Linux

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.