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

Introduction to the simple method of setting up vsFTPd in CentOS 7 system

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

Share

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

FTP is a useful protocol for transferring files on Internet and can be used when transferring files on a website. Recently, the editor needs FTP when sending files to the host www.idccoupon.com website. After all, the files are a little big, so it is difficult to transfer online, so I installed the vsFTPd service. This article simply sorts out the method of setting vsFTPd on the CentOS7 system.

First log in to the centos7 system using terminal software (such as putty). Before installing the new software, it is best to make sure that the existing software packages in the system are up to date. CentOS uses yum to manage packages. Even on a brand new server, several packages may be out of date, and the upgrade command is as follows:

Yum upgrade-y

After the upgrade is complete, you can install vsFTPd.

Yum install-y vsftpd

Before starting the FTP server, there are some key options that are set in the configuration file.

Vi / etc/vsftpd/vsftpd.conf # # or cd / etc/vsftpd/ vi vsftpdconf

By default, vsFTPd allows anonymous FTP sessions. Unless you want anyone to be able to upload or download files from your server, it is recommended that you set this option to No.

Anonymous_enable=NO

Make sure you can upload the file to the FTP server.

Write_enable=YES

These next changes ensure that when users on the server log in, they can only upload files to their own home folder.

Chroot_local_user=YESchroot_list_enable=NOallow_writeable_chroot=YES

Finally, you need to tell vsFTPd which passive ports to use. FTP servers typically receive commands from clients on one port and then return data on another port. 1000 ports 8000 and 9000 will be assigned here.

Pasv_min_port=8000pasv_max_port=9000

Save the file and exit. We can now restart vsFTPd for these changes to take effect.

Systemctl restart vsftpd

Finally, we need to add firewall rules so that vsFTPd can talk to the outside world.

Firewall-cmd-permanent-add-port=20-21/tcpfirewall-cmd-permanent-add-port=8000-9000/tcpfirewall-cmd-reload

Now, use the FTP client of your choice, log in with your user name and password, and then try to upload a file. You can use ls to list files on a terminal session by doing the following:

Ls / home/

In this way, the vsFTPd service can be built on the CentOS 7 system through the above steps, so that you can use the FTP tool 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