The ssh server port command changes the port number that an SSH server monitors.
The undo ssh server port command restores the port number that the SSH server monitors to the default value.
By default, the SSH server monitors the port number 22.
Parameter | Description | Value |
---|---|---|
port-number |
Specifies the port number that an SSH server monitors. |
The value can be 22 or is an integer ranging from 1025 to 65535. |
ipv6 |
Specifies the IPv6 port number that an SSH server monitors. |
- |
ipv4 |
Specifies the IPv4 port number that an SSH server monitors. |
- |
An SSH client can log in successfully with no port specified only when the server is monitoring port 22. If the server is monitoring another port, the port number must be specified upon login.
The ssh ipv4 server port command changes the IPv4 port number that an SSH server monitors.The ssh ipv6 server port command changes the IPv6 port number that an SSH server monitors.
After the monitoring port number is changed, all connections are disconnected and the server starts to monitor new port numbers.