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

The method of installing vsftpd and PAM virtual users in centos 6

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

Share

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

Install vsftp using yum

Yum install vsftpd pam pam-* db4 db4-*

Create a file that holds the user and password

Cd / etc/vsftpd/ touch vuser_passwd.txt

Add user (odd line user, even line password)

Vim vuser_passwd.txt tom DSfaoewLD3 ken GetpOIIofd324DLJhg

Add the account and password in the text to the database file of db4

Db_load-T-t hash-f / etc/vsftpd/vuser_passwd.txt / etc/vsftpd/vuser_passwd.db

Comment out all the original contents of vsftpd and add the following:

Sed-ir's / ^ / # / G' / etc/pam.d/vsftpd auth required / lib64/security/pam_userdb.so db=/etc/vsftpd/vuser_passwd account required / lib64/security/pam_userdb.so db=/etc/vsftpd/vuser_passwd

Create a user vsftpd of the vsftpd service, or you can use-d to specify his home directory

Useradd-d / home/vsftpd-s / sbin/nologin vsftpd

Change the configuration file of vsftpd and back up vsftpd.conf first

Cp / etc/vsftpd/vsftpd.conf / etc/vsftpd/vsftpd.conf.bak

The configuration is as follows:

# Anonymous access to anonymous_enable=NO# is not allowed. Local users can access it. Note: mainly for virtual host users, if the project is set to NO, then all virtual users will not be able to access local_enable=YES# to allow write operations write_enable=YES# to create or upload files after the permission mask local_umask=022# forbids anonymous users to upload anon_upload_enable=NO# forbids anonymous users to create directories anon_mkdir_write_enable=NO# can display some set information when entering the directory You can use message_file=.message to set dirmessage_enable=YES# to open the log xferlog _ enable=YES# active connection port number connect_from_port_20=YES# setting forbids uploading files to change the host chown_uploads=NO# log path, remember to create and chown vsftpd.vsftpd / var/log/vsftpd.logxferlog_file=/var/log/vsftpd.log# this file is the format of the log format, you know. When using wu ftp software, just set yes xferlog_std_format=YES# because we set the shell of vsftpd to nobody, so this place can write vsftpd! Of course, or you can write nobodynopriv_user=vsftpd# settings in the system that support asynchronous transfer function async_abor_enable=YES# settings support ASCII mode upload ascii_upload_enable=YES# settings support ASCII mode upload ascii_download_enable=YES# login welcome words ftpd_banner=Welcome to dongnan FTP service.# is limited to his own directory, do not let him out, for example, if set to NO, then when you log in to ftp You can access some other authorized directories on the server. Once set to YES, lock your directory and chroot_list_enable=YES# will write the user to this later. Users who write here stay at home obediently under the directory chroot_list_file=/etc/vsftpd/chroot_list# to launch the vsftpd file under listen=YES#/etc/pam.d/ by standalone pam_service_name=vsftpd# users in / etc/vsftpd/user_list will not be allowed to use FTPuserlist_enable=YES# to support TCP Wrappers firewall mechanism tcp_wrappers=YES# enable virtual user function guest_enable=YESguest_username=vsftpd# virtual user permissions in line with their The configuration file storage path of the host user virtual_use_local_privs=YES# virtual user personal vsftpd. Vsftpd_config is a folder. Note: the configuration file name must be the same as the virtual user name user_config_dir=/etc/vsftpd/vuser_conf# setting passive mode pasv_enable=yes# passive mode data transfer port range pasv_min_port=8888pasv_max_port=8899

Create a directory to save the virtual user profile

Mkdir / etc/vsftpd/vuser_conf/

Create a vsftp log file

Touch / var/log/vsftpd.log chmod 600 / var/log/vsftpd.log chown vsftpd.vsftpd / var/log/vsftpd.log

Create a profile for which users will be fixed in the home directory

Touch / etc/vsftpd/chroot_list echo-e "vsftpd\ ntom\ nken" > / etc/vsftpd/chroot_list

Just write the user name that needs to be fixed in the user directory.

Cd / etc/vsftpd/vuser_conf/cat > tom

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