Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Vsftpd configure virtual user

2025-03-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

Configuration steps:

1. Add a virtual user password file

Vim / etc/vsftpd/vuser.txt (Note: vuser.txt is defined by myself, can be any custom) candy # username 123 # password limingyu # username 123456 # password

two。 Generate virtual user password authentication

Yum install-y db4-utils # install db_load-T-t hash-f / etc/vsftpd/vuser.txt / etc/vsftpd/vuser.db# first without this tool to convert text documents into databases

3. Edit vsftpd's PAM authentication file

All other lines of vim / etc/pam.d/vsftpdauth required pam_userdb.so db=/etc/vsftpd/vuseraccount required pam_userdb.so db=/etc/vsftpd/vuser# are commented out, and write the above two lines # comment out other lines, which can prevent local users from logging in, because the verification of local users when logging in depends on this file

4. Establish locally mapped users and set host directory permissions

Useradd-d / home/vsftproot-s / sbin/nologin vuser# this user does not need to log in, but the mapping user # user name must be consistent with chmod 755 / home/vsftproot in the next configuration file

5. Modify the configuration file

Vim / etc/vsftpd/vsftpd.confguest_enable=YES# opens the system user pam_service_name=vsftpd#pam authentication file corresponding to the virtual user guest_username=vuser#ftp (default exists)

6. Restart the service and test

Service vsftpd restart or / etc/init.d/vsftpd restart # at this time, virtual users can log in, view, download, and cannot upload # the default upload location is the host user's home directory, and the anonymous user rights used by permissions are managed.

7. Adjust virtual user rights

Vim / etc/vsftpd/vsftpd.confanonymous_enable=NO# disables anonymous user login, which is more secure (does not affect virtual user login) anon_upload_enable=YESanon_mkdir_write_enable=YESanon_other_write_enable=YES# sets permissions for virtual users and allows all virtual users to upload

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report