1. install vsftp and db4sudoapt-getinstallvsftpdsudoapt-getinstalldb4.6-util 2. create a virtual user password library file sudomkdir/etc/vsftpdthe New user password file named logins.txt, sudogedit/etc/vsftpd/log... 1. install vsftp and db4sudo apt-get install vsftpdsudo apt-get install db4.6-util 2. create the sudo mkdir/etc/vsftpdfile named logins.txt, sudo gedit/etc/vsftpd/logins.txt: username with odd behavior. The password is an even-numbered password. the password of User1 is 123456 and User2 is 12345user4153456user212345adminadmin. 3. generate a vsftpd authentication file and use the db_load command to generate the authentication file: db4.6 _ load-T-t hash-f/etc/vsftpd/logins.txt/etc/vsftpd/vsftpd_login.db set the vsftpd_login.db permission to read and write only to the root user, that is, 600 chmod 600/etc/vsftpd/vsftpd_login.db 4. create the PAM configuration file required by the virtual user in/etc/pam. create vsftpd in the d directory. vu content is as follows: sudo gedit/etc/pam. d/vsftpd. vuauth required/lib/security/pam_userdb.so db =/etc/vsftpd/vsftpd_loginaccount required/lib/security/pam_userdb.so db =/etc/vsftpd/vsftpd_login 5. create system users required by virtual users and the main directory sudo useradd jtmvi-d/www-s/bin/falsesudo chown jtmvi. jtmvi/wwwsudo chown jtmvi. jtmvi/www/User1sudo chown jtmvi. jtmvi/www/User2sudo chmod 700/www 6. set vsftpd. conf configuration file: (back up first) sudo cp/etc/vsftpd. conf/etc/vsftpd. conf_old # back up gedit/etc/vsftpd. conflisten = YESanonymous_enable = NOdirmessage_enable = YESxferlog_enable = YESxferlog_file =/var/log/vsftpd. logxferlog_std_format = YESchroot_local_user = YESguest_enable = YESguest_username = jtmviuser_config_dir =/etc/vsftpd_user_confpam_service_name = vsftpd. vulocal_enable = YES 7. set different permissions for different virtual users. sudo mkdir/etc/users/etc/vsftpd_user_conf/User1write_enable = users = NOanon_upload_enable = users = YESlocal_root =/www/User1 gedit/etc/vsftpd_user_conf/User2write_enable = enabled = YESlocal_root =/www/User2gedit/etc/logs/adminwrite_enable = enabled = YESlocal_root =/ www 8. restart vsftpd/etc/init. d/vsftpd restart author But_Bueatiful
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.