SoFunction
Updated on 2025-04-09

Configuration of wu-ftp service in Linux environment



Workgroup name:

Welcome message is displayed only for the specified working group.

Variables available

%T
FTPServer host time
%F
The current space remaining in the directory partition
%C
Currently locatedFTPDirectory name
%E
FTPServer administrator'sEMAILaddress
%R
The name of the original host of the user(Remote)
%L
FTPServer host name
%U
Logged in user name
%M
The same workgroup allows up to several users to log in
%N
The number of users currently logged in to the same working group
The default values ​​are:
message / login //Indicates when anonymous user logs in,
implement/var/ftpFiles in the directorymessage .
message cwd=* //Indicates when anonymous user converts
When the directory(cwd=*),Perform the conversion directory.messageHide files。
You can enter the following content in the file:
Welcome from%RFriends!
The local host address is%L!
You are currently on the site%NDear users!
The current local time is:%T。
Your current directory is:%C。
If there is any problem,Please contact me:%E。

tar

Set file compression function. tar can set whether certain working groups are allowed to compress files online using tar. Format:

tar <Set value><Workgroup name>

Settings: The options available are yes and no; they indicate the activation and closing of the tar function.

Workgroup name: Workgroup name defined using class.

For example (defaults to allow all workgroups to use tar to compress files online)

tar yes all

The execution permissions of the instruction

This class can be used to set which categories of users are allowed to execute commands such as chmod, in the format:

chmod <Set value><User Category>
delete<Set value><User Category>
overwrite<Set value><User Category>
rename<Set value><User Category>
umask<Set value><User Category>

Settings: The options available are yes and no. It indicates whether this instruction is allowed to be executed separately. By default, everyone can execute user categories: the available categories are real, anonymous, guest.

For example (users who log in with guest and anonymous identity are not allowed to execute chmod, delete, overwrite, rename instructions)

chmod no guest,anonymous
delete no guest,anonymous
overwrite no guest,anonymous
rename no guest,anonymous

compress

You can set whether some working groups are allowed to compress files online using compress. Format:

 compress <Set value><Workgroup name>
Settings: The options available are yes, no. Indicates the start and close the workgroup name of the compress function: use the workgroup name defined by class, for example (allows all groups to use the compress function)
 compress yes all

log commands

It can be used to specify which users to record the commands executed by them, in the following format:

log commands <User Category>

User Category: The available user categories are real, anonymous, guest

For example:

log commmands real
//The record content will be stored in /var/log/xferlog.

log transfers

Can be used to specify which users to record the actions of transfer files, in the format:

log transfers <User Category><Transmission action>

User Category: The available categories are real, anonymous, guest.

Transfer action: There are two options available: inbound (used to record the actions uploaded to the server); outbound (represents to record the actions of downloading files from the server)

For example (records all actions of uploading and downloading files by anonymous user):

log transfers anonymous inbound,outbound
//The record will be written/var/log/xferlogInside。

shutdown

Set when to turn off the FTP server, format:

shutdown <Set the path to the file>

Set the file path:

The content of this setting file is about the shutdown command, and the default value is /etc/shutmsg file.

This file format is as follows:

<Year><moon><day><hour><point><cannotFTP登入的hour间><用户被踢出的hour间>
For example:
2003 12 7 0 30 20 5

// means that the FTP server was closed at 0:30 on December 7, 2003, and users are prohibited from logging in at 0:10 minutes. At 0:25, all users will be kicked out by the system.

To start FTP, delete the /etc/shutmsg file

7. Set up the upload directory

Follow the steps below to complete:

Follow the steps below to complete:

1 #cd /var/ftp //Switch to the anonymous FTP root directory

2 #mkdir upload //Create the directory upload to upload

3 #chmod 733 upload //Set the permissions of this directory to 733, that is, everyone has permissions to write and execute. or 333.

4 Add the following content to the /etc/ftpaccess file:

upload /var/ftp /upload yes root ftp 0600 nodir
/*The root directory of setting anonymous FTP is /var/ftp, the upload directory (/var/ftp/upload) behind is the directory where files can be uploaded, which allows uploading. The owner of the upload file is root, the group to which the upload file belongs is FTP, and the file permission after uploading is set to 0600 (-rw-------), and the subdirectory cannot be established. 5 Check whether the following command is set correctly.
chmod no guest,anonymous
delete no guest,anonymous
overwrite no guest,anonymous
rename no guest,anonymous

Detailed description

grammar:

upload <Upload directory><Whether it is allowed to upload [yes/no]><Owner after uploading file><Owner after uploading file><Owner group after uploading file><Permissions><Whether it is allowed to create subdirectories

[dirs/nodirs]>
/*upload command can set the path for users to upload files, or the directory where files are refused to be uploaded. It can also set the ownership and permissions of the files after upload. If you decide to open upload to the upload directory, you must first open the writeable permissions*/
#chmod a+w /var/ftp/upload
6 Settings: /var/ftpaccess file is not allowed in the directory /var/ftpaccess directory: (/etc/ftpaccess file)
 upload /var/ftp * no
upload /var/ftp/bin no
upload /var/ftp/etc no

/*When the permission is set to 0600, the files uploaded by anonymous users cannot be downloaded immediately. You need to wait for the FTP administrator to change the file permission to 0644 before you can provide download. If you want to upload the file upload to be available for download immediately, just change the file attribute to 0744, as follows: upload /var/ftp /upload yes root ftp 0744 nodirs */

Set filtering function

grammar:

path-filter &lt;User Category&gt; &lt;Information file&gt; &lt;Upload file name rules&gt;
//The function of path-filter is to filter whether the file name uploaded by the user is legal or not

Access control

The settings here can be used to define workgroups, which users are allowed or rejected, or where to log in, or

deny

Used to set which URLs this FTP server refuses to log in from, and decides that the prompt text should be displayed at this time, format:

deny &lt;Host address&gt;&lt;Prompt text file path&gt;

Host address:

IP address or domain name, the host address can be specified here, or the wildcard character * can be used.

Prompt text file path:

When the user is denied login, the location of the prompt text file is to appear.

For example (rejected user to log in from the URL and displayed information about /etc/msgs/file)

deny *. /etc/msgs/
For example (rejected to log in from the 192.168.1.0 network, and display /etc/msgs/file information)
deny 192.168.1.* /etc/msgs/
//Notice:/etc/msgs/Create files by yourself

limit

Set the maximum number of people online for a certain working group at a certain time, format:

limit &lt;Workgroup name&gt;&lt;Number of people&gt;&lt;time&gt;&lt;Prompt text file path&gt;

Workgroup name:

Workgroup name defined using class

Number of people:

Number of users allowed to log in

Time: Specify the time to be limited. The time format can be in a 24-hour system. For example, 0800-1800 means from 8 am to 6 pm. Other default formats are as follows:

Any Any date
WK Non-holiday working days
Mo Monday
To Tuesday
We Wednesday
Th Thursday
Fr Friday
Sa Saturday
Su Sunday

//In the time item, if you want to represent the time of multiple segments, the time and time can be connected in series with "|".

Prompt text file path:

When the user is denied login, the location of the prompt text file to be displayed.

For example:

/*Limited to any time, at most 20 group1 workgroup users can log in at the same time. When this number exceeds this number, users of the same workgroup will be denied to log in again and display

/etc/msgs/File information*/
limit group1 20 Any /etc/msgs/
//thisgroup1The group must exist,And byclassdefinition,The content of the file must be written by the administrator.
Examples of file content:
Sorry! Too many users!
The limit is %M.

Example 2:

/*Set on Saturday, Sunday, and Monday to Friday at 18:00 to 23:00. At the same time, up to 30 groups of users are allowed to log in. When logging in is refused, it will be displayed.

/etc/msgs/File information*/
limit group1 30 SaSu|Any 1800-2300 /etc/msgs/
//In order to prevent too many people from logging into the FTP server at the same time, it is necessary to reasonably limit the number of people logging in at the same time.