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.
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 server port command changes the IPv4/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.