As SSH is a secured alternative of Telnet hence it add the additional credential commands for added security & hence it cannot work with password only.
To enable SSH on your Router/Switch
(conf t)# hostname sw1
(conf t)# ip domain-name cisco.com
(SSH uses the host name + domain name to create the key)
(conf t)#crypto key generate rsa general-keys modulus 1024 (generates key pairs & key modulus size is 360-4096) (768 keys at least for SSH v2)
(you may use ''#ip ssh version 2' command to enable more stable SSH Version)