Linux vsFTPD installation and configuration file and configuration virtual user

Source: Internet
Author: User
Tags php web server pkill

You know what is Linux vsFTPD? This very advanced application technology will be explained by me very much. Where is Linux vsFTPDNB? I will introduce you to the unlimited field of Linux vsFTPD. Linux vsFTPD is a small and easy-to-use FTP server program. It is one of the most popular FTP server programs in the Linux release version. It features a small, lightweight, secure, and easy-to-use version.

Installation of Linux vsFTPD

The Linux vsFTPD software package is included in the latest installation disks of the major release editions, and can be installed using the software package management tool provided by the corresponding release editions. Of course, you can also find the Linux vsFTPD software package in the FTP images of various major releases and install it online using the software package management tool. We recommend that you use the software provided by the release version to install it. We do not recommend you compile the source code package by yourself. The Fedora or Redhat system can be installed online using the following command;

 
 
  1. [Root @ localhost ~] # Yum install vsftpd
  2. For debian systems, you can use apt for online installation;
  3. [Root @ localhost ~] # Apt-get install vsftpd
  4. For RPM systems, you can also find the vsftpd-xxxx.rpm package to install through the rpm command;
  5. [Root @ localhost ~] # Rpm-ivh vsftpd *. rpm
  6. Download and install the source code package
  7. [Root @ localhost ~] # Tar zxvf vsftpd-2.0.3.tar.gz
  8. [Root @ localhost ~] # Cd vsftpd-2.0.3
  9. [Root @ localhost ~] # Make; make install
  10. [Root @ localhost ~] # Cp vsftpd. conf/etc
  11. Modify/etc/vsftpd. conf and add the following line to the last line of the configuration file;Listen = yes

If your system is an RPM package-managed system, you can delete the/etc/xinetd. d/vsftpd file and start the xinetd server;

 
 
  1. [Root @ localhost ~] #/Etc/init. d/xinetd restart
  2. Stop xinetd: [OK]
  3. Start xinetd: [OK]
  4. Running vsFTPd Server
  5. [Root @ localhost ~] #/Usr/sbin/vsftpd &
  6. [Root @ localhost ~] #/Usr/local/sbin/vsftpd &
  7. Disable vsFTPd Server

Use pkill vsftpd to kill the Linux vsFTPD process. In this way, disable Linux vsFTPD and use psgrep vsftpd to view the process. If no process exists, it indicates that Linux vsFTPD has been disabled. Use the root permission.

 
 
  1. [Root @ localhost ~] # Pkill vsftpd
  2. [Root @ localhost ~] # Pgrep vsftpd
  3. Enable or disable the vsFTPd server in Fedora/Redhat/CentOS:
  4. In Fedora/Redhat/CentOS, you can also use the following method to start vsFTPd; of course, you also need to use the root permission;
  5. [Root @ localhost beinan] #/etc/init. d/vsftpd start
  6. Start vsftpd For vsftpd: [OK]
  7. Restart vsFTPd with the following command;
  8. [Root @ localhost beinan] #/etc/init. d/vsftpd restart
  9. Disable vsftpd: [OK]
  10. Start vsftpd For vsftpd: [OK]
  11. To disable the vsFTPd server, run the following command;
  12. [Root @ localhost beinan] #/etc/init. d/vsftpd stop
  13. Disable vsftpd: [OK]

Linux vsFTPD configuration file

Vsftpd. conf is the configuration file of the Linux vsFTPD server, which is usually/etc/vsftpd. conf or/etc/vsftpd. conf, vsftpd. the conf configuration file is the global control file of the Linux vsFTPD server. In this configuration file, each row should be regarded as a rule. After the configuration is complete, it must be restarted.

Configure virtual users in Linux vsFTPD

FTP users generally cannot log on to the system, which is also for security. In the system, users who do not have the permission to log on to the system are also known as virtual users. Virtual users also need to be written into/etc/passwd. This is just a virtual user method, but it is not really a virtual user, but the permission to log on to the SHELL is removed, so he is not able to log on to the system; if we want to locate the beinan user directory in the/opt/beinan directory and cannot log on to the system, we should perform the following operations.

 
 
  1. [Root @ localhost ~] # Adduser-d/opt/beinan-g ftp-s/sbin/nologin beinan
  2. [Root @ localhost ~] # Passwd beinan
  3. Changing password for user beinan.
  4. New password:
  5. Retype new password:
  6. Passwd: all authentication tokens updated successfully.
  7. [Root @ localhost ~] #
  8. In fact, this is not enough. We need to change the configuration file vsftpd. conf to ensure that the local virtual user has the read and write permissions;
  9.  
  10. Local_enable=YES 
  11. Write_enable=YES 
  12. Local_umask=022 
  13. How to implement a virtual path?

For example:

 
 
  1. /Home/a ing is ftp: // localhost/
  2. /Home/B/c is set to ftp: // localhost/c
  3. You can achieve this by using the following method.
  4. [Root @ localhost ~] # Mount-bind [original directory] [new directory]
  5. For example, if my default ftp directory is/var/ftp, I want to map the/mnt/LinG/WinSoft folder to the/var/ftp directory. I will perform the following operations:

Create a directory in the/var/ftp directory first.

 
 
  1. [Root @ localhost ~] # Mkdir/var/ftp/WinSoft
  2. Run the mount command.
  3. [Root @ localhost ~] # Mount-bind/mnt/LinG/WinSoft/var/ftp/WinSoft
  4. In this case, OK.

Enable the log function of the Linux vsFTPDv Server

Correct # In Front Of xferlog_file below, that is, enable the log function of vsftp, so that we can view vsftpd. log in the/var/log directory. This is the log function of vsFTP, which is extremely important for us. Xferlog_file =/var/log/vsftpd. log how can I limit the number of connections of the vsFTP server and the maximum number of connections for each IP address? Change the configuration file vsFTPD. conf of the Linux vsftpd server and add the following two lines:

 
 
  1. Max_clients= Number
  2. Max_per_ip= Number
  3. For example, I want to add up to 100 vsFTP connections and up to five connections for each IP address. Therefore, I should add the following two lines in vsftpd. conf:
  4. Max_clients=100 
  5. Max_per_ip=5 
  6. How can I limit the transmission speed?
  7. Anon_max_rate= Number
  8. Note: This is an anonymous speed.
  9. Local_max_rate= Number
  10. Note: This is the speed of local users on the vsFTP server.
  11. Note: The unit of this number is byte, so we need to calculate it.
  12. For example, if I want Anonymous Users and vsFTP users to download data at 80 KB, the number should be 1024 ×80=81920 
  13. Therefore, we need to add the following two lines to vsftpd. conf:
  14. Anon_max_rate = 81920
    Local_max_rate = 81920
  1. Linux vsftpd installation and startup, and logon under the command line, view Chinese file garbled
  2. Install and compile MySQL 5.1.34 extension library and Php Web server in Linux Nginx
  3. Linux MySQL program service built-in security mechanism
  4. Linux MYSQL command to modify the method of various connections
  5. Linux Oracle accesses MySQL Client software

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.