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 configure FTP Server in Linux system

2025-01-17 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 configure the FTP server in the Linux system. 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.

Brief introduction of FTP server: FTP is the English abbreviation of File Transfer Protocol (File transfer Protocol), while the Chinese abbreviation is "File transfer Protocol".

It is mainly used for the two-way transfer of control files on Internet.

It is also an application (Application). There are different FTP applications based on different operating systems, and all of these applications follow the same protocol to transfer files.

In the use of FTP, users often encounter two concepts: "Download" and "Upload". To "download" a file is to copy a file from a remote host to your own computer, and to "upload" a file is to copy a file from your own computer to a remote host.

In the Internet language, users can upload (download) files to (from) a remote host through a client program. Because the file transfer of FTP is in clear text, which is dangerous, a more secure transmission method, vsftp, is born. The following mainly introduces the steps of building a FTP server in Linux.

Steps to build a FTP server in Linux: 1. Check the installation of vsftpd server

After entering the terminal with root (other accounts can enter the root mode after entering the password with su root), enter the following command in the terminal command window to verify: # rpm-qa | grep vsftpd. If the result shows "vsftpd-1.1.3-8", the system already has a vsftpd server installed. If there is no reply, it is not installed in the system.

The 2.rhel version of the system CD comes with the vsftpd installation package, so the next step is to mount the system CD to / media for retrieval.

3. The screenshot above shows that the vsftpd server is not installed in this system, then install it with the rpm command.

This is the command to install vsftpd in the terminal command window: # rpm-ivh vsftpd-1.1.3-8.i386.rpm.

(1) mount optical drive first, and there is rpm,rpm-ivh vsftpd* in the / mnt/cdrom/Server directory

4. Create a user

(1) start the service first

(2) create two users

Configuration of 5.vsftpd

After installation, there will be three configuration files under the / etc/vsftpd/ path.

Vsftpd.conf: main profile

Ftpusers: specify which users cannot access the FTP server, including some important users such as root.

User_list: whether the specified user can access the ftp server, through the configuration of userlist_deny in the vsftpd.conf file to determine whether the user in the configuration can access, userlist_enable=YES, userlist_deny=YES, userlist_file=/etc/vsftpd/user_list these three configurations allow users in the file to access FTP.

(1) View the default configuration of the main configuration file: (use: cat / etc/vsftpd/vsftpd.conf | grep-v'^ #';)

(2) modify the configuration file:

After logging in to ftp, we will find that users can access other directories and have the permission of the mpsp group, which is not allowed. We need to control the access scope of users to their home directories. The methods are as follows:

A. vi / etc/vsftpd/vsftpd.conf enter the ftp configuration file directory and edit this file

b. Find # chroot_list_enable=YES and delete the previous # number, which means that this restriction function is enabled

Find chroot_list_file:chroot_list_file=/etc/vsftpd/chroot_list and delete the previous # sign to enable this restriction function; join chroot_local_use=NO

(press I to start editing after entering the edit box)

c. After entering the configuration file, add the following three lines at the end:

① userlist_enable=YES

Userlist_deny=NO

Userlist_file=/etc/vsftpd/vsftpd.user_list

d. Prohibit anonymous users from logging in

(after editing, press esc and use ": wq" to save and exit)

e. Edit some files

① finds the vsftpd.chroot_list file in the etc directory and enters the editing state

Add the user name you want to restrict, one user per line, such as ftp2

(after editing, press esc and use ": wq" to save and exit)

② enters the vsftpd directory, finds vsftpd.user_list, and types ftp11, which means that ftp11 is allowed to log on to the ftp server

(after editing, press esc and use ": wq" to save and exit)

Then on the local machine, through the console, use ftp1 to access the system through ftp, the user successfully logged in, and successfully restricted to their own home directory, unable to access other directories.

Two users are created by the method in turn, ftp1 and ftp2.

Check ftp status sestatus-b | grep ftp:

Then enter:

Turn off the firewall:

The following steps are to achieve mutual ping communication between the host and the virtual machine:

End result:

This is the end of the article on "how to configure the FTP server in the Linux system". I hope the above content can be of some help 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

Development

Wechat

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

12
Report