Enabling SSH on a Cisco Catalyst Switch

Enabling SSH on a Cisco Catalyst Switch

Here's a step-by-step guide on how to enable SSH on a Cisco Catalyst switch:

1. Access the Switch Console

  • Connect to the console port of the switch using a console cable and a terminal emulation program like PuTTY or Tera Term.  

2. Enter Privileged EXEC Mode

  • Enter your username and password when prompted.
  • Type enable and press Enter.
  • Enter the enable password when prompted.

3. Enter Global Configuration Mode

  • Type configure terminal and press Enter.

4. Configure Hostname and Domain Name

  • Set a hostname for your switch:
    hostname <hostname> 
    
    For example:
    hostname SW1
    
  • Configure the domain name:
    ip domain-name <domain_name>
    
    For example:
    ip domain-name your_domain.com
    

5. Generate RSA Keys

  • Generate an RSA key pair:
    crypto key generate rsa
    
    • You will be prompted for the modulus size. A common value is 1024 or 2048 bits.  

6. Enable SSH on VTY Lines

  • Configure the VTY lines to allow SSH connections:
    line vty 0 15 
    transport input ssh
    login local
    

7. (Optional) Configure SSH Version

  • Specify the SSH version to use:
    ip ssh version 2 
    

8. Save the Configuration

  • Save the configuration to the startup configuration file:
    copy running-config startup-config
    

9. Verify SSH Configuration

  • Check the SSH configuration using the show running-config command.

10. Connect to the Switch via SSH

  • Use an SSH client (such as PuTTY) to connect to the switch using its IP address and the username you configured.  

Example Configuration

Switch# configure terminal
Switch(config)# hostname SW1
Switch(config)# ip domain-name your_domain.com
Switch(config)# crypto key generate rsa 
Switch(config)# line vty 0 15
Switch(config-line)# transport input ssh
Switch(config-line)# login local
Switch(config)# ip ssh version 2 
Switch(config)# end
Switch# copy running-config startup-config 

Configuration Video





Comments