Vsftpd: Set up FTP on LinuxUbuntu

Source: Internet
Author: User
Operating System: For Ubuntu (GNU/Linux) to set up an ftp server on the host, we need to install ftp server software. Representative ftp server software in Linux includes Wu-FTP, ProFTP and Vsftp. Wu-FTP (WashingtonUniversityFTP) is developed by the University of Washington. It has powerful functions and is relatively replicated in configurations. Because of its early development time and extensive application, it has become the main target of hackers. ProFTP is weak for Wu-FTP

Operating System: Ubuntu (GNU/Linux)

To set up an ftp server on the machine, we need to install the ftp server software. Representative ftp server software in Linux includes Wu-FTP, ProFTP and Vsftp.
Wu-FTP (Washington University FTP) is developed by the University of Washington. It has powerful functions and is relatively replicated in configurations. Because of its early development time and extensive application, it has become the main target of hackers.
ProFTP is developed for the weaknesses of Wu-FTP, which improves security and provides some functions not available in Wu-FTP, greatly simplifying the setup and Management of FTP servers.
Vsftp has excellent performance in terms of security, high performance, and stability. Its main functions include virtual IP settings, virtual users, standalone (daemon that can be independently started), and inetd operation mode (managed by a special super daemon ), powerful single-user setting capabilities and bandwidth throttling. Next we will explain how to set up vsftpd on ubuntu.

Vsftpd installation:
In ubuntu, you can install sudo apt-get install vsftpd directly through apt.

After the installation is complete, check whether the vsftpd process is started. You can view the process or the listening port.
Ps-eaf | grep vsftpd

Vsftpd process enabled

Netstat-tnl | grep: 21

Port 21 is being monitored


Vsftpd configuration file:
In ubuntu, the main configuration file distribution of vsftpd is as follows:
/Etc/vsftpd. conf configuration file of the vsftpd Server
Process file of/usr/sbin/vsftpd Server
/Etc/pam. d/vsftpd the PAM interface configuration file of the vsftpd Server
/Var/ftp vsftpd Server Anonymous user's working directory

Configure the vsftpd Server:
The configuration file of the vsftpd server and Its Parameter meanings are as follows:
/Etc/vsftpd. conf

Vsftpd. confListen = YES
Listen_ipv6 = YES # listen = YES and listen_ipv6 = YES are set to YES, which means that the task runs in an independent mode (daemon can be started independently). The former listens to ipv4, and the latter listens to ipv6, however, the two cannot be set in a configuration file at the same time.
Anonymous_enable = YES # indicates that anonymous users are allowed to log on to the FTP server.
Anon_world_readable_only = NO # As long as the ftp user has the read permission in the operating system, the file can be downloaded.
Anon_root =/var/ftp/anonymous # after an anonymous user logs on to the/var/ftp/anonymous directory, the files in the directory can be downloaded.
Anon_uploads_enable = YES # anonymous users can upload files.
Anon_mkdir_write_enable = YES # anonymous users can create directories on the server.
Anon_other_write_enable = YES # anonymous users can name, delete, and write data on the server.

Local_enable = YES # Allow local user accounts to log on
Local_umask = 022 # indicates the initial permission value of a local user when creating a new file. 022 indicates that the initial permission value is that the Creator has all permissions. Other users (including group users and other users) only have read and execution permissions. 077 indicates that the initial creator has all permissions, other users do not have permission

Write_enable = YES # indicates that the server receives write-related control commands.

Dirmessage_enable = YES # indicates that the first time a user enters a new directory, some prompt information will be provided to the user.
Use_localtime = YES # indicates that the server displays the local time zone. The default value is the GMT time.


Xferlog_enable = YES # logs can be generated
Xferlog_std_format = YES # The log adopts the standard xferlog format.
Xferlog_file =/var/log/vsftpd. log # log file and directory

Connect_from_port_20 = YES # use port 20 as the source port for data connection Establishment

Pam_service_name = vsftpd # specify the name of the PAM service configuration file, in/etc/pam. d

Chown_uploads = YES # These two options are related configurations, indicating that the files uploaded by anonymous users will become whoever. This configuration is for security purposes.
Chown_username = whoever # After the file owner changes to another user, anonymous users cannot delete or even read the file, for example, submitting a job to FTP

Idle_session_timeout = 600 # indicates that the connection timeout value is 600 seconds.
Data_connection_timeout = 120 # indicates that the data connection timeout value is 120 seconds.

Nopriv_user = ft420cure # indicates that when the vsftpd process is in a non-privileged running state, the user identity used is ft420cure

Async_abor_enable = NO # indicates that vsftpd supports the FTP command "async ABOR". This command affects the security of vsftpd. Generally, the default NO setting is used.

Ascii_upload_enable = YES
Ascii_download_enable = YES # indicates that the ASCII mode is true for uploading and downloading files. Some FTP servers are vulnerable to DoS attacks when implementing the ACSII transmission mode. To avoid sending in this case, vsftpd can pretend to allow the AXSCII mode when returning to the client, but actually uses the binary mode, which is achieved by setting these two values to NO.
Ftpd_banner = Welcome to stone FTP service. # indicates that the Welcome to stone FTP service information will be displayed when you log on. If this option is not available, the name and version of the vsftpd server will be displayed, with security issues, the purpose of this operation is to hide the information.

Deny_email_enable = YES # If an anonymous user enters aaa @ as the logon password, the user is denied. The main purpose is to prevent some automatic logon tools from logging on.
Banned_email_file =/etc/vsftpd. banned_emails # specified deny_mail File

Chroot_list_enable = YES # these two options define a user list, which is placed in the/etc/vsftpd/chroot_list file. When chroot_local_user
Chroot_list_file =/etc/vsftpd/chroot_list # after being set to NO, after these users log on to the FTP server, they will see their own root directory, that is to say, although in the actual file system, the upper-level directories of these users' personal directories still exist, they cannot be switched to these upper-level directories.

Chroot_local_user = YES # When chroot_local_user is set to YES, the above user list will not be restricted in the personal directory and can be further transferred to other directories

Ls_recurse_enable = YES # indicates that the client can add the-R parameter when using the ls command. The-R parameter indicates that the ls command can list the contents of the entire directory tree, which takes some processing time, especially when malicious users exist, the situation is more serious.

Anon_max_rate = 0 # used to set the maximum rate that an anonymous user client can reach. The value is a numerical value, in B/s. 0 indicates no limit.
Local_max_rate = 0 # This option limits the speed of Local Users
Max_clients = 0 # maximum number of client connections that vsftpd can receive
Max_per_ip = 5 # limit the number of clients that can be connected to each host. To speed up the download, users may open many client connections, affecting the normal use of other users.

Recommended reading:

Ubuntu practical and simple FTP erection http://www.linuxidc.com/Linux/2012-02/55346.htm

Set up FTP server and Apache server http://www.linuxidc.com/Linux/2011-04/35295.htm on Ubuntu

Install LAMP \ vsftpd \ Webmin \ phpMyAdmin service and set http://www.linuxidc.com/Linux/2013-06/86250.htm in Ubuntu 13.04

Simple case http://www.linuxidc.com/Linux/2013-04/82300.htm for anonymous uploading of SeLinux and vsftpd on RHEL6 Platform

Linux vsftpd source code installation http://www.linuxidc.com/Linux/2013-03/81475.htm

Case study of vsftpd Security Configuration http://www.linuxidc.com/Linux/2012-12/76501.htm

 

Next please see 2nd page highlights: http://www.linuxidc.com/Linux/2013-09/90564p2.htm

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.