< Home

ftp server port

Function

The ftp server port command specifies the listening port number of the FTP server.

The undo ftp server port command restores the default value of the listening port number.

The default value is 21.

Format

ftp [ ipv6 ] server port port-number

undo ftp [ ipv6 ] server port

Parameters

Parameter Description Value
ipv6 Specifies the IPv6 FTP server. -
port port-number Specifies the listening port number of the FTP server. The value is 21 or an integer that ranges from 1025 to 55535.

Views

System view

Default Level

3: Management level

Usage Guidelines

Usage Scenario

By default, the listening port number of the FTP server is 21. Attackers may frequently access the default listening port, which wastes bandwidth, deteriorates server performance, and prevents authorized users from accessing the FTP server through the listening port. You can run the ftp server port command to specify another listening port number to prevent attackers from accessing the listening port.

Prerequisites

Before running the ftp server port command to specify the listening port number, you must first run the undo ftp server command to disable FTP services.

Precautions

  • After the ftp server port command is executed, the FTP server disconnects all FTP connections and uses the new listening port.

  • If the current listening port number is 21, FTP client users do not need to specify the port number for logging in to the FTP server. If the current listening port number is not 21, FTP client users must use the FTP server's listening port number to log in to the FTP server.

  • After the listening port number is changed, you must run the ftp server enable command to enable FTP services to make the configuration take effect.

Example

# Change the port number of the FTP server to 1028.
<HUAWEI> system-view
[HUAWEI] undo ftp server
[HUAWEI] ftp server port 1028
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >