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

Detailed explanation of FTP service construction in linux-- 3. Virtual user

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

Share

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

operating environment

OS: Redhat 6.5

IP Address: 192.168.10.128

Hostname: zred

Operating System: Win 7

IP address: 192.168.10.10

Confirm that the two hosts are interconnected.

Requirement: add a virtual user to access ftp.

First we restart the service.

Add Virtual Account

Edit a file vuser

[root@localhost vsftpd]# vim /etc/vsftpd/vuser

Put two users in it.

Convert vuser to database file for PAM recognition

[root@localhost vsftpd]# db_load -T -t hash -f vuser vuser.db

And then modify the file permissions, can strengthen security, so as not to be peeped at by others.

Create a user to specify the home directory for vuser/opt/vuser and log in without using shell

[root@localhost vsftpd]# useradd -d /opt/vuser -s /sbin/nologin vuser

Edit pam authentication module to support virtual user login

[root@localhost vsftpd]# vi /etc/pam.d/vsftpd.vu

Add two sentences to it.

auth required pam_userdb.so db=/etc/vsftpd/vuser //a will be lost

account required pam_userdb.so db=/etc/vsftpd/vuser /* The two files vuser is not an ordinary file but the vuser.db database file created just now. */must be omitted here.

Edit the master profile and add permission statements for guest users at the end

guest_enable=YES

guest_username=vuser

pam_service_name=vsftpd.vu

Restart the service and try to log in

We can also specify a separate configuration folder

Insert at the end of the main configuration file:

user_config_dir=/etc/vsftpd/vu_dir /* Separate user configuration folder */

create a profile

mkdir vu_dir

vi /etc/vsftpd/vu_dir/tom /* Create a user profile in the configuration folder */

anon_umask=022 /* Specify permission to upload files */

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