The ssh server port port-number command changes the port number of the SSH server.
The undo ssh server port command cancels the port number of the SSH server and restores the default value.
By default, the port number of the SSH server is 22.
| Parameter | Description | Value |
|---|---|---|
port-number |
Specifies the port number of the SSH server. |
The value can be 22 or any integer that ranges from 1025 to 55535. The default number of the standard port is 22. Some ports are reserved for the L2TP module. Therefore, do not use these ports when configuring SSH. The reserved port numbers vary according to the device model.
NOTE:
The reserved ports do not distinguish between TCP and UDP. That is, both TCP and UDP ports are reserved. |
ipv4 |
Indicates changing IPv4 SSH service port. |
- |
ipv6 |
Indicates changing IPv6 SSH service port. |
- |
After setting the port number of the SSH server, you need not specify the port number only if the port number of the SSH server is 22. Otherwise, you must specify the port number when the SSH client logs in.
After you run the ssh server port port-number command, the numbers of ports used by the SSH server to monitor the IPv4 and IPv6 protocol packets are both changed. To change the number of the port used by the SSH server to monitor the IPv4 or IPv6 protocol packets separately, run the ssh { ipv4 | ipv6 } server port port-number command.
If a new listening port is set, the SSH server cuts off all established STelnet and SFTP connections, and uses the new port number to listen to connection requests.