Article Title: configure the vsftpd service. Linux is a technology channel of the IT lab in China. Including desktop applications, Linux system management, kernel research, embedded systems, open-source and other basic classification configuration vsftpd services: Linux is an open-source and secure operating system that has been deeply rooted in the hearts of the people. As a popular release of Linux, Ubuntu is more popular. As the most convenient FTP program in Linux, vsftpd is also highly respected. This article describes how to configure the vsftpd service.
Service start and stop
Before starting the service, edit the configuration file/etc/vsftpd. conf. after opening the configuration file, you can see many rows starting with "#". These rows are comments and are mostly help information. You can read them carefully. Vsftpd. all projects in the conf file are set with "parameter = value". The format is strictly required and must be case sensitive. No space is allowed on either side of the equal sign, there cannot be spaces at the end of each line. Each parameter has a default value. If the parameter is not explicitly specified in the configuration file, the default value is used. We will ignore the original information in the configuration file, delete or comment out all the content, and add the following four lines. The text on the right of each line is a description, do not enter it in the file:
1. listen = yes // vsftpd works in standalone mode. 3. anonymous_enable = yes // allows anonymous users to log on to the server. 4. 5. local_enable = yes // allow local users to log on to the server 6. 7. pam_service_name = vsftpd // use PAM for authentication 8. vsftpd has two working modes: standalone mode and xinetd daemon mode. Line 1 is to make it work in standalone mode. In this mode, the vsftpd service must be restarted every time the configuration file is modified to take effect. The two modes are described in detail later. We also copied the vsftpd. pam file under the Redhat Directory to the/etc/pam. d/vsftpd file during installation. This file is the pam Authentication configuration file that the local user logs on. This document will be detailed later. We need to know that this configuration file must be available, and the pam_service_name = vsftpd statement must be added to the main configuration file to allow local users to log on. Run the following command to start the service:
1. [root @ redhat vsftpd-2.3.2] #/usr/local/sbin/vsftpd & // start vsftp 2. We can check whether the vsftpd server is running through pgrep vsftpd;
1. [root @ redhat vsftpd-2.3.2] # pgrep vsftpd 2. 3.4248 4. the above shows that the vsFTPd server is running. You can test the connection by using ftp commands, lftp tools, gftp, or other FTP clients;
To ensure that the service is started, run the following command:
1. [root @ redhat vsftpd-2.3.2] # netstat-an | grep 21 2. 3.tcp 0 0 0.0.0.0: 21 0.0.0.0: * LISTEN 4. we can see that port tcp21 has been opened on the server, indicating that ftp has been started. Then log on to the server:
1. [root @ redhat vsftpd-2.3.2] # ftp 127.0.0.1 2. 3. connected to 127.0.0.1. 4. 5.220 (vsFTPd 2.0.5) 6. 7.530 Please login with USER and PASS. 8. 9.530 Please login with USER and PASS. 10. 11. KERBEROS_V4 rejected as an authentication type 12. 13. name (127.0.0.1: root): ftp 14. 15.331 Please specify the password. 16. 17. password: 18. 19.230 Login successful. 20. at this time, we have logged on to the server using an anonymous user (ftp or anonymous with any password, You can also log on with a local user. During the test, we recommend that you use the ftp command shown above (windows, Linux, and Unix all carry this command, and the usage is the same) to log on to the server, so that you can see more detailed information, it is very helpful for debugging servers. The simplest ftp server has been built.
Run the following command to disable the ftp service:
1. [root @ redhat vsftpd-2.3.2] # killall vsftpd // or pkill vsftpd 2. 3. [root @ redhat vsftpd-2.3.2] # pgrep vsftpd // check whether the vsftpd server has been disabled 4. auto-start
Use vi to open etc/rc. local and add/usr/local/bin/vsftpd & to it.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service