In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "CentOS how to build FTP file service", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "CentOS how to build FTP file service" this article.
Build FTP file service based on CentOS for your reference. The details are as follows
System requirements: CentOS 7.264-bit operating system
one。 Install VSFTPD
(vsftpd is a FTP server widely used on Linux. According to its [official website] [https://security.appspot.com/vsftpd.html]] [https://security.appspot.com/vsftpd.html]], it is probably the most secure and fast FTP server software under UNIX-like.)
Yum install vsftpd-y
Start VSFTPD (after installation is complete, start the FTP service)
Service vsftpd start
After startup, you can see that the system has [listened for port 21]: the FTP protocol uses port 21 as the service port by default.
Netstat-nltp | grep 21
At this point, visit ftp:// to browse the / var/ftp directory on the machine.
two。 Configure FTP permissions
At present, FTP service login allows anonymous login, and it is impossible to distinguish user access. We need to configure FTP access rights.
The configuration directory of vsftpd is / etc/vsftpd and contains the following configuration files:
Vsftpd.conf configure user list forbidden access to FTP server for main profile ftpusers configure user access control for user_list
Read the above configuration for more information. If you are ready, click next to modify the configuration to set permissions.
Prevent anonymous access and switching the root directory (anonymous access and switching the root directory will bring [security risk] to the server, we turn these two functions off) Edit / etc/vsftpd/vsftpd.conf
# disabling anonymous user anonymous_enable=NO# forbids switching root directory anonymous access allows everyone to upload files to the server without authentication, while allowing switching to the root directory may lead to unauthorized access. Chroot_local_user=YES
Restart the FTP service:
Service vsftpd restart
three。 Create a FTP user
# create a user ftpuseruseradd ftpuser # set the password echo "Password" for the user ftpuser | passwd ftpuser-- stdin
Restrict the user's access to the server only through FTP: restrict user ftpuser to access the server only through FTP and cannot log in directly to the server
Usermod-s / sbin/nologin ftpuser
Assign home directories to users
Create a [home directory] for user ftpuser and agree to:
/ data/ftp is the main directory, which cannot upload files
/ data/ftp/pub files can only be uploaded to this directory
Mkdir-p / data/ftp/pub
Create a login welcome file:
Echo "Welcome to use FTP service." > / data/ftp/welcome.txt
Set access permissions:
Chmod a murw / data/ftp & & chmod 777-R / data/ftp/pub
Set to the user's home directory:
Usermod-d / data/ftp ftpuser
four。 Prepare domain name and certificate (CVM)
To resolve the domain name to the experimental CVM, it will take some time for the domain name to take effect after it is set and resolved. Check whether the domain name is valid through the ping command: if the information returned by the ping command contains the resolved IP address you set, the resolution is successful.
Ping jikexianfeng.xyz
five。 Access the FTP service
Access through Windows Explorer: Windows users can copy the following link to the explorer's address bar to access:
Ftp://ftpuser:xoAEUG5c@118.89.65.22
Access through the FTP client tool:
There are many FTP client tools, and two commonly used ones are recommended:
FTP and SFTP connection client under WinSCP-Windows
FileZilla-Cross-platform FTP client that supports Windows and Mac
After downloading and installing the FTP client, connect using the following credentials:
Host ip: your host ip
User: ftpuser
Password: xoAEUG5c
The above is all the contents of the article "how to build FTP File Service in CentOS". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.