I'm trying to configure a 2960 switch to use public key authentication rather than a username and password.
I create the private key and export the public and add it to the switch config using.
(config)#username user1
(config)#aaa authentication login default local
(config)#ip ssh pubkey-chain
(conf-ssh-pubkey)#username user1
(conf-ssh-pubkey-user)#key-string
(conf-ssh-pubkey-data)# "Public Key String"
(conf-ssh-pubkey-data)#exit
(conf-ssh-pubkey-user)#exit
(conf-ssh-pubkey)#exit
(config)#line vty 0 15
(config-line)#transport input ssh
When I try logging in using SSH I'm able to log in with or without the key and without entering a password. Are there additional configs required on the switch to use the key for authentication?