Setting passwords for the 2900/2950 series switches is the same method as used for a router.
2900Switch(config)#enable password cisco
Sets enable password to cisco
2900Switch(config)#enable secret class
Sets encrypted secret password to class
2900Switch(config)#line con 0
Enters line console mode
2900Switch(config-line)#login
Enables password checking
2900Switch(config-line)#password cisco
Sets password to cisco
2900Switch(config-line)#exit
Exits line console mode
2900Switch(config-line)#line aux 0
Enters line auxiliary mode
Exits line auxiliary mode
2900Switch(config-line)#line vty 0 4
Enters line vty mode for all five virtual ports
Exits line vty mode
2900Switch(config)#