Vsftpd virtual user by difference folder

Source: Internet
Author: User
RedHat 4:
1. Create accuont & password dB, which can be deleted after logins.txt is used.

VI logins.txt

Testa
Testap
Testb
Testbp

Db41_load-T-t hash-F/tmp/logins.txt/etc/vsftpd/vsftpd_load.db

Chmod 600/etc/vsftpd/vsftpd_load.db

2. Create vsftpd. vu in/etc/PAM. d/to add
Auth required/lib/security/pam_userdb.so DB =/etc/vsftpd/vsftpd_load
Account required/lib/security/pam_userdb.so DB =/etc/vsftpd/vsftpd_load

3. Add a local account

Useradd-D/virtual-S/sbin/nologin virtual

4. Modify vsftpd Configuration
VI/etc/vsftpd. conf
Change and add
Anonymous_enable = No
Xferlog_file =/var/log/vsftpd. Log
Guest_enable = Yes
Guest_username = Virtual
Pam_service_name = vsftpd. vu
User_config_dir =/etc/vsftpd/virtual

5. create directory and User Permissions
Mkdir/etc/vsftpd/virtual
Mkdir/virtual/TESTA
Mkdir/virtual/testb

Chmod 700/virtual/TESTA
Chmod 700/virtual/testb

Chown vsftpd: vsftpd/virtual/TESTA
Chown vsftpd: vsftpd/virtual/testb

VI/etc/vsftpd/virtual/TESTA

Local_root =/virtual/TESTA
Write_enable = Yes
Anon_world_readable_only = No
Anon_upload_enable = Yes
Anon_mkdir_write_enable = No
Anon_other_write_enable = No

VI/etc/vsftpd/virtual/testb

Local_root =/virtual/testb
Write_enable = Yes
Anon_world_readable_only = No
Anon_upload_enable = yes # can or not upload
Anon_mkdir_write_enable = No
Anon_other_write_enable = No # can or not delete

6. Restart vsftpd
/Sbin/service vsftpd restart

It is strange that 64bit is always unsuccessful.

Related Article

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.