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

What about the Linux file server?

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article will explain in detail how to do the Linux file server for you. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

Vsftpd is based on the access of system users to the ftp server, the more system users, the less conducive to management and system security, so it is solved by the way of vsftp virtual protection.

Virtual users do not have actual real system users, but access authentication by mapping to one of the real users and setting corresponding permissions, virtual users can not log in to the system.

1. Install the software and authentication module that the virtual user needs to use

[root@www] # yum install pam* libd-utils libdb*-- skip-broken-y

two。 Create a virtual user temporary file

/ etc/vsftpd/ftpusers.txtxj3123456xj4123456

3. Generate virtual user database authentication file with permission of 700

[root@www vsftpd] # db_load-T-t hash-f / etc/vsftpd/ftpusers.txt / etc/vsftpd/vsftpd_ login.db[ root @ www vsftpd] # chmod 700 / etc/vsftpd/vsftpd_login.db

4. Configure the pam authentication file / etc/pam.d/vsftpd to add the following two lines of code:

Auth_required pam_userdb.so db=/etc/vsftpd/vsftpd_loginaccount_required pam_userdb.so db=/etc/vsftpd/vsftpd_login

5.vsftp virtual users need to be mapped to a system user, who does not need a password or login, and is mainly used for virtual user mapping.

Useradd-s / sbin/nologin ftpuser

6.vsftpd configuration

# globle config vsftpd 2018 anonymous_enable=NO local_enable=YES write_enable=YES local_umask=022 dirmessage_enable=YES xferlog_enable=YES connect_from_port_20=YES xferlog_std_format=YES listen=YES listen_ipv6=NO userlist_enable=YES tcp_wrappers=YES# config virtual user ftp pam_service_name=vsftpd Virtual user Enterprise pam Authentication guest_enable=YES enable Virtual user guest_username=ftpuser Mapping Virtual user to system use The directory where the user ftpuser user_config_dir=/etc/vsftpd/vsftpd_user_conf virtual user profile is located the virtual_use_local_privs=YES virtual user uses the same permissions as the local user

7 so far, all virtual users use the / home/ftpuser home directory to upload and download. You can create their own profiles in the / etc/vsftpd/vsftpd_user_conf directory. The main entries for creating virtual user profiles are as follows:

Mkdir-p / etc/vsftpd/vsftpd_user_conf/

8, create a profile for the virtual user and create a private virtual directory

Vim / etc/vsftpd/vsftpd_user_conf/xj3local_root=/home/ftpuser/xj3 Virtual user profile path write_enable=YES allows login users to have write permissions anon_world_readable_onle=YES allows anonymous users to download, then reads files anon_upload_enable=YES allows anonymous users to upload files, and only takes effect when write_enable=yes is anon_mkdir_write_enable=YES allows anonymous users to create directories Effective only if write_enable=yes is anon_other_write_enable=YES allows anonymous users other permissions, such as delete, rename vim / etc/vsftpd/vsftpd_user_conf/xj3local_root=/home/ftpuser/xj3write_enable=YESanon_world_readable_onle=YESanon_upload_enable=YESanon_mkdir_write_enable=YESanon_other_write_enable=YES

9 create respective virtual directories for virtual users

Mkdir-p / home/ftpuser/ {xj3,xj4}; chown-R ftpuser:ftpuser / home/ftpuser on "what to do with the Linux file server" this article is shared here, I hope the above content can be helpful to you, so that you can learn more knowledge, if you think the article is good, please share it for more people to see.

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

Servers

Wechat

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

12
Report