Change VTY Port Number
Rotary Group feature allows us to change the listening port of a connection. If we need to change the listening port of a vty line, with rotary we can change telnet or ssh port to another one.
The rotary command applied to a vty line makes the telnet connection start to listen connections on ports 3000-3099. So if we want to allow telnet of port 3007 we can do the following:
router(config)# line vty 3
router(config-line)# rotary 7
And to disable access to port 23, then:
router(config)# access-list 99 deny tcp any any eq 23
router(config)# access-list 99 permit tcp any any
router(config)# line vty 3
router(config)#access-class 99 in