How to Enable SSH on Cisco Switches – Quick Reference

Enabling SSH on Cisco switches is essential for secure network management. Below is a step-by-step guide with commands and explanations.


Command Reference Table

StepCommandPurpose
1hostname MySwitch
ip domain-name example.local
Set switch hostname and domain
2username admin privilege 15 password YourSecurePasswordCreate a local admin user
3crypto key generate rsa modulus 2048Generate RSA key pair for SSH
4ip ssh version 2Enable SSH version 2
5line vty 0 4
transport input ssh
login local
Allow only SSH on VTY lines
6copy running-config startup-configSave running configuration


Additional Tips

  • To disable Telnet, restrict VTY access:

line vty 0 15 transport input ssh
  • Testing SSH from a PC:

ssh -l admin <switch-ip>
  • The recommended RSA key size is 2048 bits.

评论

此博客中的热门博文