Issue the set ip permit enable telnet command in order to completely disable Telnet access to the switch that runs Catalyst OS.
Note: Do not specify any IP address in order to give access. This command actually enables Telnet, but if no IP address is specified to give access, then by default this disables all Telnet access.
In order to disable or restrict Telnet access on a switch that runs Cisco IOS , you must disable, delete or modify additional line vty that allows the Telnet access. Issue these commands:
switch(config)#line vty 0 4
switch(config-line)#transport input ssh