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

CentOS 7 build FTP service and install and configure vsftpd service

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

Share

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

This article is to share with you CentOS 7 to build FTP services and install and configure vsftpd services tutorials, I believe that most people have not learned how to install and build, in order to let you learn, to sum up the following content.

I. ftp file transfer service

1. Port number of the FTP connection

21: transmission control is used for authentication and authorized access

20: transfer data using 2, FTP connection mode

Active mode: the server transmits data to the client through port 20. The POST instruction indicates an active connection. The default works in active mode.

Passive mode: the server opens a specified range of port numbers to wait for the client to establish a data connection. The pasv instruction indicates passive mode 3 and FTP transmission mode.

Text mode: text mode does not support the transmission of streaming media data, but supports text files

Binary mode: use a widely supported way to transfer text file streaming data 4, FTP authentication

Anonymous: authentication using ftp users or anonymous accounts does not require a password

Local authentication: you need to use an account password to access data after authentication

Virtual account authentication: mapping multiple users to a system account for authentication 2. Install vsftpd service 1, install vsftpd service [root@centos01 ~] # rpm-ivh / mnt/Packages/vsftpd-3.0.2-22.el7.x86_64.rpm [root@centos01 ~] # rpm-ivh / mnt/Packages/ftp-0.17-67.el7.x86_64.rpm 2, Configure virtual user 1) create virtual account database file [root@centos01 ~] # vim / etc/vsftpd/vusers.list bobpwd@123tompwd@123alicepwd@1232) generate virtual account database file Database file vusers.db [root@centos01 ~] # db_load-T-t hash-f / etc/vsftpd/vusers.list / etc/vsftpd/vusers.db3) add virtual account mapping to create ftp root directory [root@centos01 ~] # mkdir / benet [root@centos01 ~] # useradd-d / benet/ftproot-s / sbin/nologin virtual4) set the permissions of the ftp root directory [root@centos01 ~] # chmod 755 / benet/ftproot/3, Configure pam authentication and create virtual account permissions directory 1) configure PAM authentication [root@centos01 ~] # vim / etc/pam.d/vsftpd.vu#%PAM-1.0auth required pam_userdb.so db=/etc/vsftpd/vusersaccount required pam_userdb.so db=/etc/vsftpd/vusers2) create virtual machine account permissions directory [root@centos01 ~] # mkdir / etc/vsftpd/vusers_dir4, Modify vsftp main configuration file configure virtual account ftp1) modify main configuration file [root@centos01 ~] # vim / etc/vsftpd/vsftpd.confanonymous_enable=NO local_enable=YES write_enable=YES local_umask=022 anon_umask=022 dirmessage_enable=YESxferlog_enable=YES connect_from_port_20=YES xferlog_std_format=YES listen=NO listen_ipv6=YES chroot_local_user=YESallow_writeable_chroot=YESguest_enable=YES guest_username=virtual user_config_dir=/etc/vsftpd / vusers_dir/ pam_service_name=vsftpd.vu userlist_enable=YES tcp_wrappers=YES 2) Common options for main profile

3) create a virtual account permissions file [root@centos01 ~] # touch / etc/vsftpd/vusers_dir/ bob [root @ centos01 ~] # touch / etc/vsftpd/vusers_dir/ tom[ root @ centos01 ~] # touch / etc/vsftpd/vusers_dir/alice4) give bob users full control of access to ftp [root@centos01 ~] # vim / etc/vsftpd/vusers_dir/bob anon_upload_enable=YES anon_mkdir_write_enable=YES anon_ Other_write_enable=YES 5) set the tom account with upload permission [root@centos01 ~] # vim / etc/vsftpd/vusers_dir/tomanon_upload_enable=YES 6) modify the owner of the ftp root directory [root@centos01 ~] # chown virtual:virtual / benet/ftproot/7) start the ftp service Set the [root@centos01] # systemctl start vsftpd [root@centos01 ~] # systemctl enable vsftpd 8) client to verify bob permissions when booting up

9) client verifies tom permissions

10) client verifies alice permissions

These are the details of CentOS 7 building FTP service and installing and configuring vsftpd service. Have you learned anything after reading it? If you want to know more about it, you are welcome to follow the industry information!

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