Follow the below commands to configure Console, VTY and Auxiliary port passwords on a Cisco Switch:
Line Console Password
Console port is used to access the switch using a console port.
Switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#line con
Switch(config)#line console 0
Switch(config-line)#password ABCD
Switch(config-line)#login
Switch(config-line)#exit
Telnet Password Virtual Terminal (VTY)
VTY is virtual terminal line which controls inbound telnet sessions or connections. When we configure “line vty 0 4” command it means we are allowing only 5 remote simultaneous connections to the switch.
Switch#config t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#line vty 0 4
Switch(config-line)#password ABCD
Switch(config-line)#login
Switch(config-line)#end
Switch#
Auxiliary Port Password
Switch#config t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#line aux 0
Switch(config-line)#password ABCD
Switch(config-line)#login
Switch(config-line)#end
Switch#