Here we'll look at how to enable the ssh server on Cisco catalyst Switches.
Switch(config)# hostname <StSwitch>
StSwitch(config)# interface vlan1
StSwitch(config-if)# ip address 192.168.1.100 255.255.255.0
StSwitch(config-if)# no sh
StSwitch(config)# username ssh_user privilege 15 secret <StPassword>
StSwitch(config)# crypto key generate rsa usage-keys label std-rsa-keypair modulus 4096
StSwitch(config)# ip ssh version 2
StSwitch(config)# ip ssh dh min size 4096
StSwitch(config)# line vty 0 15
StSwitch(config-line)# transport input ssh
StSwitch(config-line)# login local
StSwitch(config)# ip scp server enable
StSwitch(config)# line vty 0 15
StSwitch(config-line)# exec-timeout 15
StSwitch(config)# service tcp-keepalives-in
StSwitch(config)# ip ssh logging events
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDxtzImfgV3cP65wmmzACuGufkdo723NNq12lmu4WjhRIp+9mMe6ELx748sHYOkDtQtCLkrqMk+I6/kaTCxWr67dYn0l1KOD6MTTPOiAskzXiExQ6L0TJXFbRLzb7NREI4DAhEmL6oqHnvur96ddO0NIpjwSU817twabycw7xDTJKSsZpsUfcUSM6bqXjFUlYpP1TdKuujMew4flS5Eg5h7vjjk2S/obcHYj1JnjyHhLxvvItFezdK1sPj7P5tzYafXMmx3uskdjhV4Dcw8cEXA8x47A+MzWMqE30NR5OENG9PqDN5kGCoRSoEnlkhFKTrP/RMa+ElJuOachuM0ptRhVjmh9dXydMbpKM3liuUED1gYWhLdv2CQLatyz5HLeBF8PsegY7lSKTyuwpuLbwsJ9ipXktsuj/FAoU56xeEs1h83df7bPFlVhKZLCmoxIftKuEAaD4QTHvSONKQa94PN2I3INYW6DN9iXHyiG+G8/l3RFrkv6zu7KMN0gEv0BzTODgcyFCPosoZFmrHeqcXjW9K5Bc7JOJCTxvxPOcLAlXo70OUNv+bZkDEGTdz8nWs8qttWn0Jndc6PxaziyprDbMCt0Zv8CrWRzgAWkEovA3RrGPQQMz7KhJ5LPV5cL9ErXx4O410rxH/ZuK0/sRDH6+zwqvv8kNrPXmhfiUAjHw== user@sthost
StSwitch(config)# ip ssh pubkey-chain
StSwitch(conf-ssh-pubkey)# username ssh_user
StSwitch(conf-ssh-pubkey-user)# key-string
StSwitch(conf-ssh-pubkey-data)# <Paste client public key here. ⚠️By block of 254 characters maximum!⚠️>
StSwitch(conf-ssh-pubkey-data)# exit
StSwitch(conf-ssh-pubkey# exit
Contact :