Sharing _ftp server by configuring a full-featured wu-ftp server in a Linux environment

Source: Internet
Author: User
Tags anonymous format message rfc822 syslog ftp client

The FTP service can be divided into two categories depending on the service object: One is the system FTP server, which only allows legitimate users on the system, and the other is an anonymous FTP server that Anonymous FTP server and uses anyone to log on to the FTP servers to get files. Below, this article describes how to use wu-ftp to erect an FTP server in a Linux system.

First, select and install FTP server software

If you are installing the Linux system, select "FTPD" When you choose to start the process, after installing the Linux system, it has installed a default FTP server into the system. We can already use it to implement the function of the system FTP server. We just need to make some personalized settings on the basis of our needs.

In most Linux versions are selected Washingtonuniversity FTP, it is a well-known FTP server software, generally referred to as wu-ftp. It is powerful and works well with many Unix operating systems, such as IBM AIX, FreeBSD, HP-UX, NeXTstep, Dynix, SunOS, Solaris, and so on. So the FTP server on the Internet, half has adopted it. WU-FTP has many powerful features that are well-suited to the management requirements of larger-throughput FTP servers:

1, the user can download the file at the same time to do automatic compression or decompression operation;

2, can be different on the network of machines to do different access restrictions;

3, can record the file upload and download time;

4, can display the transmission of relevant information, user-friendly timely understanding of the current transmission dynamics;

5, can set the maximum number of connections, improve efficiency, effectively control the load.

Ii. composition of the Wu-ftp

After installing the WU-FTP, you will see the following five executables in the/bin directory:

FTPD FTP Server program

Ftpshut for shutting down the FTP server program

Ftpcount Show current online numbers

Ftpwho View current FTP server connections

Ckconfig Check that the FTP server is set correctly


In addition to these executables, it also generates seven profiles under the/ETC and/var directories:

/etc/ftpusers

/etc/ftpaccess

/var/run/ftp.pids

/etc/ftpconversions

/var/log/xferlog

/etc/ftpgroups

/etc/ftphosts

When WU-FTP is installed, a special user FTP is created and a ftpd directory is created in the/home directory, which is automatically positioned when the user logs on anonymously. Several subdirectories are typically created in this directory.

/home/ftpd/bin Store executable files for use by FTP users

/HOME/FTPD/ETC Store Some profiles for use by FTP users

/home/ftpd/pub information stored for download

/home/ftpd/incoming storage space for uploaded information

iii. configuration of Wu-ftp

1. View Modified/etc/inetd.conf file

The/etc/inetd.conf file is the inetd configuration file for the Linux system's Super server. It is responsible for listening on multiple TCP/IP ports. When it receives a request, it derives a corresponding server from the configuration file. By using a super server, other services can be derived only when needed, resulting in significant savings in system resources. And Wu-ftp is using the hyper-polar server inetd to listen for requests. When the super server inetd receives the FTP request from the client, it opens an FTP service process based on the configuration file.

So if we're going to use wu-ftp, we have to confirm that there is one in the inetd configuration file inetd.conf of the Super server: FTP stream TCP nowait ROOT/USR/SBIN/TCPD Wu.ftpd to derive a wu-ftp FTP service process when the Super server receives an FTP request. (Note: To confirm that there is such a row, you can use the file Content Lookup command to confirm that: cat/etc/inetd.conf grep ftp If it is not, it is manually added or manually modified).
2, wu-ftpd command options WU-FTPD

The wu-ftpd command option WU-FTPD is the WU-FTP service process. It can be executed with no parameters or with parameters. The following is a brief introduction to WU-FTPD's execution parameters:

-D error into syslog of the system when an error occurs on the FTP server;

-L to the syslog of the system in which each FTP client is connected;

-T set the FTP client connection to disconnect for several minutes without operation;

-A enables WU-FTP to use the/etc/ftpaccess setting;

-A enables WU-FTP to not use the/etc/ftpaccess setting;

-L RECORD the program executed by the FTP client on the syslog of the system;

-I log the FTP client upload file in the/usr/adm.xferlog file;

-O log record of downloading files to FTP clients

In the/usr/adm/xferlog file.

By understanding the above parameters, we suggest that the default configuration of the above system installation be changed to: FTP Stream TCP nowait ROOT/USR/SBIN/TCPD wu.ftpd–a–i

3. Provide automatic compression and decompression function

If you want the FTP server to have automatic compression, decompression function, you must first some compressed, uncompressed command files such as tar, gzip, gunzip, Compress, uncompress, and other command files to the/home/ftpd/bin directory.

4. About/etc/ftpaccess Settings

This configuration file is the most important configuration file on the FTP server, it is directly related to your FTP server can work correctly, there are many permissions on the settings. The following is a typical configuration instance.

Copy Code code as follows:

Loginfails 3
Class Local Real *
Class Remote Anonymous Guest *
Limit remote ANY/ETC/FTPD/TOOMANY.MSG
MESSAGE/ETC/FTPD/WELCOME.MSG Login
Compress Yes local remote
Tar Yes local remote
Private Yes
Passwd-check rfc822 warn
Log Commands Real
Log Transfer anonymous guest inbound outbound
Log Transfer Real Inbound
Shutdown/etc/ftpd/shut.msg
Delete No anonymous,guest
Overwrite no anonymous,guest
Rename No Anonymous
chmod no Anonymous,guest
Umask No Anonymous
UPLOAD/HOME/FTPD * No
Upload/home/ftpd/bin No
UPLOAD/HOME/FTPD/ETC No
Upload/home/ftpd/pub Yes real 0644 dirs
Upload/home/ftpd/incoming Yes real guest anonymous 0644 dirs
Alias In/incoming
Email guest@xxx.net
Email guest@yyy.net
Deny *.com.tw/etc/ftpd/deny.msg

Let's explain it step by step and give the meaning of each set, so that everyone analogy, so that according to their own FTP server specific conditions for reasonable settings.

1) format: loginfails [times]

Function: Sets the number of times the user is allowed to lose the wrong password when logged in to the FTP server.

Example: Loginfails 3: The password input error three times to cut off the connection.

2) Format: class [class name] [real/guest/anonymous] [IP Address]

Function: The function of this instruction sets the user's category on the FTP server. The IP address of the client can be restricted to allow access to the IP address or the full IP address of a certain part. Users on an FTP server can basically be grouped into the following three categories:

Real users with legitimate accounts on the FTP server;

The guest has a record of anonymous users;

Anonymous anonymous user with minimal privileges

Instance: Class Local Real *: Defines a class named Local that contains real users who log on anywhere (* representing all IP addresses).

Class Remote Anonymous Guest *: Defines a class named remote that contains anonymous users and guest users who log on anywhere.

3) format limit[category] [number] [TIME] [filename]

Function: The function of this instruction is to allow the specified number of connections to be set for the specified time limit. Displays the contents of the specified file when the maximum number is reached.

Example: Limit remote any/etc/ftpd/toomany.msg: At any time, remote class access users to 100 people, will no longer allow the creation of new connections, when the 101th customer to connect, the connection will fail, and like the user to show the file /etc/ftpd/toomany.msg's content.

4 format message [file name] [instruction]

Function: When the user executes the specified instruction, the system displays the specified file contents.

Example: Message/etc/ftpd/welcome.msg login: When the user executes the login command, that is, when they log on to the FTP server, the system displays the contents of the file/etc/ftpd/welcome.msg.
5) Format: Compress [yes/no] [category]

Features: Sets which category of users can use the Compress (compression) feature.

Example: Compress Yes local remote: Allows users in both local and remote two categories to use the Compress (compression) feature.

6) Format: tar [yes/no] [category]

Features: Sets which category of users can use the TAR (archive) feature.

Instance: Tar Yes local remote: Allows users of both local and remote classes to use the TAR feature.

7) Format: private [yes/no]

Function: Set whether to support the group to access the file.

Instance: Private Yes: Supports group access to files.

8) Format: Passwd-check [none/trivial/rfc822] [Enforce/warn]

Function: Sets the password usage for anonymous user anonymous.

None means no password verification, any password can be logged in;

Trival said that as long as the input password contains the character "@" can be logged in;

RFC822 said the password must conform to the RFC822 in the e-mail format required to log in;

Enfore indicates that the password entered does not conform to the format specified above and does not allow login;

Warn indicates that the password does not meet the requirements of the warning message only appear, still able to log on.

Example: Passwd-check rfc822 warn: Want to be able to get the required e-mail as a password, but if not, also allow login.

9) Format: Log command [real/guest/anonymous]

Features: Sets which user logged on actions are recorded in the file/usr/adm/xferlog.

Instance: Log command real: When a real user logs in, records his actions. Because other user rights are lower, so the operation does not cause too much security risks, so it is generally necessary to write down the operation of real users.

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.