The ftp server port command enables the FTP service on the specified port of an FTP server.
The undo ftp server port command restores the default setting.
By default, the port number is 21.
| Parameter | Description | Value |
|---|---|---|
| ipv6 | Indicates the IPv6 FTP server. | - |
| port port-number | Specifies the number of the port monitored by the FTP server. | The value is an integer that is 21 or ranges from 1025 to 55535. By default, the port number is 21. |
Usage Scenario
By default, the listening port number of an FTP server is 21. You can directly log in to the device without specifying the port number. Attackers may access the default listening port, consuming bandwidth, deteriorating server performance, and causing authorized users unable to access the server. To improve security, run this command to change the listening port number of the FTP server. After that, attackers are deprived of information about the newly configured listening port number, and the FPT server is therefore well protected.
Prerequisites
Confirm that the FTP server function has been disabled. If not, run the undo ftp server command to disable the FTP server function.
Configuration Impact
The FTP server closes all FTP connection and uses the new listening port.
If the listening port number of the FTP server is 21, the FTP client can log in to the FTP server without specifying the port number. If the listening port number of the FTP server is not 21, the FTP client needs to specify the port number when trying to log in to the FTP server. The specified port number must be identical with the listening port number of the FTP server.
Precautions
After the listening port number of the FTP server is changed using the ftp server port command, run the ftp server enable command to enable the FTP server function.