How to create an FTP server (1)

Source: Internet
Author: User
Tags ftp site

FTP servers are widely used. So let's introduce how to create an FTP server. In practice, the FTP server must provide the upload and download functions. In addition, for security considerations, user authentication, user permission settings, and space management are also required. Next we will build such an FTP server.

Create an FTP server 1. Create a welcome message. If you want to see a welcome message or an introduction to this directory when entering the directory, you can use the following methods.

Check whether dirmessage_enable = YES is in the/etc/vsftpd. conf file. By default, Red Hat 9.0 has this setting. Add a file named. message in the directory. In this example, create a. message file in the/home/ylg directory with the content "Welcome to my FTP site ".

Create an FTP server 2. Change the default port of the FTP server. Change the default port 21 to port 2121 based on security considerations. Use vi to open/etc/vsftpd. conf:

 
 
  1. #vi /etc/vsftpd/vsftpd.conf  

Add the following line at the end of the file:

 
 
  1. listen_port=2121  

Create an FTP Server 3. Cancel anonymous logon. Find the following line in the vsftpd. conf file and change its value to "NO ":

 
 
  1. anonymous_enable=YES  

Create an FTP server 4. Set the user to not change the directory. This is also based on security considerations. Generally, the user's default directory is/home/username. If you do not want users to switch to the first-level directory/home after logon, you can use the following settings. Find the following three lines in the/etc/vsftpd. conf file:

 
 
  1. #chroot_list_enable=YES 
  2. # (default follows)  
  3. #chroot_list_file=/etc/vsftpd.chroot_list  

Change it:

 
 
  1. chroot_list_enable=YES 
  2. # (default follows)  
  3. chroot_list_file=/etc/vsftpd/chroot_list  

Add a file/etc/vsftpd/chroot_list with two usernames:

 
 
  1. ylg  
  2. user1  

Create an FTP Server 5. limit the speed for different users. Assume that ylg can use a maximum speed of kb/s, and user1 can use a maximum speed of kb/s, you can set it in the following ways. Add the following line at the end of the/etc/vsftpd. conf file:

 
 
  1. user_config_dir=/etc/vsftpd/userconf  

Add a directory named/etc/vsftpd/userconf:

 
 
  1. #mkdir /etc/vsftpd/userconf  


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.