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
| Step | Command | Purpose |
|---|---|---|
| 1 | hostname MySwitch ip domain-name example.local | Set switch hostname and domain |
| 2 | username admin privilege 15 password YourSecurePassword | Create a local admin user |
| 3 | crypto key generate rsa modulus 2048 | Generate RSA key pair for SSH |
| 4 | ip ssh version 2 | Enable SSH version 2 |
| 5 | line vty 0 4 transport input ssh login local | Allow only SSH on VTY lines |
| 6 | copy running-config startup-config | Save running configuration |
Additional Tips
-
To disable Telnet, restrict VTY access:
-
Testing SSH from a PC:
-
The recommended RSA key size is 2048 bits.
评论
发表评论