Second, Advanced Configuration
1, the use of independent services
A.VI/ETC/XINETD.D/VSFTPD Disable=no also changed to Yes, no longer need it!
B.vi/etc/vsftpd.conf at the end plus Listen=yes
C.servicexinetdrestart
d./usr/local/sbin/vsftpd/etc/vsftpd.conf&
Ok! Now VSFTP is already the service that starts independently!
2, the use of unconventional ports (2121)
A.vi/etc/vsftpd.conf
Add listen_port=2121, save exit
B.killall-9vsftpd
c./usr/local/sbin/vsftpd/etc/vsftpd.conf&
ok! now with ftp127.0.0.1 will prompt you the connection is rejected (FTP:CONNECT:CONNETIONREFUESD)! Then ftp127.0.0.12121 enter the username and password, ok! Can log in!
3, the realization of different users different permissions
Now we are to achieve the different permissions of three users: A.upload users can upload a download, you can create a new folder, but can not delete files and folders, cannot rename existing files and folders; b.download users can only download; c.admin users, administrators, can upload, can download, can create a new folder, may To delete and change the file and folder names. None of these users can log on to the system and lock in their home directory when using FTP to access the system folder.
A.cat<<!>logins.txt
>upload
>******* #upload用户的密码
>download
>*******
>admin
>****************
>!
Description, the format of this text file is: Singular behavior user name, even behavior password
B.db_load-t-thash-flogins.txt/etc/vsftpd_login.db
C.chmod600/etc/vsftpd_login.db
D.cdvsftpd-1.2.1/example;cpviryual_users/vsftpd.pam/etc/pam.d/ftp.vu (Enter the source directory of your solution, copy the authentication file of the virtual user to/etc/pam.d/)
E.useradd-d/home/ftpsitevirtual;chmod700/home/ftpsite;su-virtual-c "echohello>/homt/ftpsite/ Test.file (set up the FTP directory to which the virtual user will access and set permissions for only virtual user access and create a file to download the experiment)
f.vi/etc/vsftpd.conf Insert the following configuration statement in this file
Guest_enable=yes (Enable virtual user)
Guest_username=virtual (Mapping a virtual user to a local user virtual)
Pam_service_name=ftp.vu (Specify Pam profile as Ftp.vu)
user_config_dir=/etc/vsftpd_user_conf (Specify the location of different virtual user profiles)
Save exit
G.mkdir/etc/vsftpd_user_conf
H. Opening different permissions for different users echo "Anon_world_readable_only=mo" >/etc/vsftpd_user_conf/download (open download users download rights-Download only Note that this place does not write Yes, otherwise you will not be able to list files and directories.
Cp/etc/vsftpd_user_conf/download/etc/vsftpd_user_conf/upload
Vi/etc/vsftpd_user_conf/upload, add the following line
Write_enable=yes (add Write permission)
Anon_upload_enable=yes (add upload permission)
Anon_mkdir_write_enable=yes (Increase the permissions to create a directory)
Cp/etc/vsftpd_user_conf/upload/etc/vsftpd_user_conf/admin
Add one line:
Anno_other_writer_enable=yes (add delete/rename permissions for admin users)
I. Testing
killall-9vsftpd;/usr/local/sbin/vsftpd/etc/vsftpd.conf&
ftp127.0.0.12121
Username Download and you set the password login, LS, you can see the file, download, success! Put a file, prompt permissiondenied. Renametest.file same permission is denied; Deletetest.file is equally unsuccessful!
Enter quit exit to upload user login, ok! can upload, download, MKDIRLSF, hint "/LSF" CREATED;RENAMELSFLSF1 hint permissiondenied, delete file also unsuccessful!
Enter quit exit, login to Admin user, can have above all permission, then RMDIRLSF, hint removedirectoryo[erationsuccessful; Deletetest.file hint deleteoperationsuccessful! OK, it's done!
4, also limited speed, limit the number of connections to the same IP, limit the maximum number of connections, and so on, I have written in another article, this no longer repeat!