Linux vsftpd Compile installation and configuration allows local users to log on to FTP
1, download vsftpd source
wget https://security.appspot.com/downloads/vsftpd-2.3.4.tar.gz
2, compile vsftpd source code
The cp/lib64/libcap.so.1/lib/libcap.so.1 command is executed before 64-bit systems are compiled:
Copy Code code as follows:
Tar xzvf vsftpd-2.3.4.tar.gz
CD vsftpd-2.3.4
Make
Make install
3. Configure VSFTPD
Copy Code code as follows:
CP Vsftpd.conf/etc
CP Redhat/vsftpd.pam/etc/pam.d/ftp
sed i ' s/anonymous_enable/#anonymous_enable =yes/g '/etc/vsftpd.conf
sed i ' s/#local_enable =yes/local_enable=yes/g '/etc/vsftpd.conf
sed i ' s/#write_enable =yes/write_enable=yes/g '/etc/vsftpd.conf
sed i ' s/#local_umask =022/local_umask=022/g '/etc/vsftpd.conf
sed i ' s/#chroot_local_user =yes/chroot_local_user=yes/g '/etc/vsftpd.conf
4, start vsftpd and set boot up
/USR/LOCAL/SBIN/VSFTPD &
Sed-i ' $a \/usr/local/sbin/vsftpd & '/etc/rc.d/rc.local
5, add FTP user (user name: ftpuser FTP root directory/home/wwwroot/ftpuser)
useradd-d/home/wwwroot/ftpuser-g ftp-s/sbin/nologin ftpuser
Local user authentication method
(1) Download files
wget http://jaist.dl.sourceforge.net/project/buluoos/0.1/src/vsftpd-2.2.2.tar.gz
Tar zxvf vsftpd-2.2.2.tar.gz
CD vsftpd-2.2.2
(2) Edit program code. Use the Tcp_wrappers validation method to cancel Pam validation.
Sed-i ' s/undef vsf_build_tcpwrappers/define vsf_build_tcpwrappers/g ' builddefs.h
Sed-i ' s/define vsf_build_pam/undef vsf_build_pam/g ' builddefs.h
(3) Installation
Make-j 8
(4) Add system User "Nobody" (this user may already exist)
Useradd Nobody
(5) Create directory "/usr/share/empty" (this directory may already exist)
mkdir/usr/share/empty/
(6) Install the VSFTPD configuration file, can execute the program.
Install-m 644 vsftpd.conf/etc/vsftpd.conf
Install-m 755 VSFTPD/USR/LOCAL/SBIN/VSFTPD
Install-m 644 VSFTPD.8/USR/SHARE/MAN/MAN8
Install-m 644 Vsftpd.conf.5/usr/share/man/man5
(7) Edit the configuration file
Cat >>/etc/vsftpd.conf<<eof
Anonymous_enable=no
Local_enable=yes
Write_enable=yes
Tcp_wrappers=yes
Eof
(8) Start vsftpd
/usr/local/sbin/vsftpd/etc/vsftpd.conf &
* Use the system user to log in after installation, preferably using a user running a Web server, so that you can avoid uploading and then modifying the owner's group and permissions.
* Installation file download address is not local, if not valid, you can search for a download address, other installation steps do not affect.