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

How to build FTP server in Linux system

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

Share

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

This article will explain in detail how to build a FTP server in the Linux system. The content of the article is of high quality, so the editor will share it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

FTP, like linternet service, is also a client / server system, which is mainly suitable for a set of protocols for file transfer over the network.

About FTP: FTP is a software for uploading and downloading. Through it, users can connect their PC to the server running FTP protocol and access the programs and information on the server.

Like most Internet services, FTP is a client / server system. The user issues a command to the server program through the client program, and the server program executes the command issued by the user and returns the result of the execution to the client.

For example, a user issues a command that requires the server to send a copy of a file to the user, and the server responds to this command by sending the specified file to the user's machine. The client program receives this file on behalf of the user and stores it in the user directory.

Linux system to build ftp specific methods: 1, shown as the following figure indicates that the vsftp software has been installed. If it is not shown, you need to install the vsftpd software.

If not, install through the yarm source

Yum install-y vsftpd

2. After the installation is complete

Go to the root directory of ftp and configure it in the / etc/vsftpd/ file by default

Core configuration file for / etc/vsftpd/vsftpd.conf:vsftpd

/ etc/vsftpd/ftpusers: used to specify which users cannot access the FTP server. Black list

/ etc/vsftpd/user_list: specifies the user list file that is allowed to use vsftpd. White list

/ etc/vsftpd/chroot_list: specifies the user list file that is allowed to use vsftpd. * whether the directory under the control list can leave the ftp root directory *

* vsftpd.conf is configured as follows: *

Anonymous_enable=NO # allows anonymous users to access the contents of the file (.message) specified by the message_file option in this directory when entering the directory if umaskdirmessage_enable=YES # allows local users to log in to write_enable=YES # whether to write to local_umask=022 # umaskdirmessage_enable=YES # uploaded files by local users for safe selection xferlog_enable=YES # enables the log

Xferlog_std_format=YES # standard format connect_from_port_20=YESxferlog_file=/var/log/xferlog # ftp log directory

Idle_session_timeout=6000 # set client connection time

Data_connection_timeout=1200 # sets the data connection time for upload. If the download chroot_list_enable=YESchroot_list_file=/etc/vsftpd/chroot_list # is set to YES, the following control is valid chroot_list_enable=YES # if it is NO, the user recorded in the file specified by chroot_list_file (default is / etc/vsftpd.chroot_list) will be logged in by chroot in the directory after login and cannot leave. If YES, the recorded user will not be chroot. Here, if YES.chroot_local_user=YESuserlist_deny=NO # is set to YES, users recorded in the file specified by the userlist_file option (default is / etc/vsftpd.user_list) will not be able to login, and will check the following userlist_deny option userlist_enable=YES # if it is NO, only login requests from users recorded in the file specified by the userlist_file option (default is / etc/vsftpd.user_list) will be accepted. Requests from these users will not be accepted if it is YES. Userlist _ file=/etc/vsftpd/user_list # whitelist chroot_list_enable=YESlocal_root=/var/ftp/pub # Root listen=YESpam_service_name=vsftpduserlist_enable=YEStcp_wrappers=YES*3, create whitelist useradd xxx passwd xxx and add it to user_list and * * chroot_list** *

* 4. Turn off the firewall *

* centoos 7 operates as systemctl stop firewalld.service*

* centoos 6 operation bit service stop iptables;*

* 5. Start the ftp server *

* cetoos 7 operates as / bin/systemctl restart vsftpd.service*

* centoos 6 operates as service vsftpd restart*

* 6. Empower, assign the root directory specified by ftp to 777 permissions *

* chmod 777 / var/ftp/pub*

* 7. Check SElinux status and close *

**********

Getsebool-a | grep ftp

If the centoos7 is finished here, you can access it with the ftp tool or pass the local ftp server test with rpm-ivh rpm... The installation package installs the ftp client configuration.

If centoos 6, you are setting several permissions:

Through: setsebool httpd_enable_ftp_server 1 can be set to the following state. View it through * getsebool-a | grep ftp*.

On how the Linux system to build FTP server to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can 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

Development

Wechat

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

12
Report