How to set telnet password on CISCO Switch.

I want to set password when I telnet to my switch. Thank you to P’1 for help me this issue.


sw>enable
sw#configure terminal
sw(config)#line vty 0 4
sw(config-line)#login
sw(config-line)#password newpassword
sw(config-line)#end
sw>write

Please test by telnet to this switch from other terminal before you close this terminal.