Configuring SSH
Configuring SSH
Catalyst 2960-X Switch Security Configuration Guide, Cisco IOS Release 15.0(2)EX
OL-29048-01 1
Configuring Secure Shell (SSH)
Restrictions for Configuring Secure Shell
Related Topics
Secure Copy Protocol, on page 4
Related Topics
Secure Copy Protocol, on page 4
Catalyst 2960-X Switch Security Configuration Guide, Cisco IOS Release 15.0(2)EX
2 OL-29048-01
Configuring Secure Shell (SSH)
SSH and Switch Access
Note The SSH client functionality is available only when the SSH server is enabled.
User authentication is performed like that in the Telnet session to the device. SSH also supports the following
user authentication methods:
• TACACS+
• RADIUS
• Local authentication and authorization
Related Topics
Configuring the Switch for Local Authentication and Authorization
TACACS+ and Switch Access
RADIUS and Switch Access
Catalyst 2960-X Switch Security Configuration Guide, Cisco IOS Release 15.0(2)EX
OL-29048-01 3
Configuring Secure Shell (SSH)
Secure Copy Protocol Overview
• If you get CLI error messages after entering the crypto key generate rsa global configuration command,
an RSA key pair has not been generated. Reconfigure the hostname and domain, and then enter the
crypto key generate rsa command. For more information, see Related Topics below.
• When generating the RSA key pair, the message No host name specified might appear. If it does, you
must configure a hostname by using the hostname global configuration command.
• When generating the RSA key pair, the message No domain specified might appear. If it does, you must
configure an IP domain name by using the ip domain-name global configuration command.
• When configuring the local authentication and authorization authentication method, make sure that AAA
is disabled on the console.
Related Topics
Setting Up the Switch to Run SSH, on page 5
Configuring the Switch for Local Authentication and Authorization
Note When using SCP, you cannot enter the password into the copy command. You must enter the password
when prompted.
Related Topics
Prerequisites for Configuring Secure Shell, on page 1
Catalyst 2960-X Switch Security Configuration Guide, Cisco IOS Release 15.0(2)EX
4 OL-29048-01
Configuring Secure Shell (SSH)
How to Configure SSH
SUMMARY STEPS
1. enable
2. configure terminal
3. hostname hostname
4. ip domain-name domain_name
5. crypto key generate rsa
6. end
7. show running-config
8. copy running-config startup-config
DETAILED STEPS
Example:
Switch> enable
Example:
Switch# configure terminal
Step 3 hostname hostname Configures a hostname and IP domain name for your Switch.
Note Follow this procedure only if you are configuring the
Example: Switch as an SSH server.
Switch(config)# hostname your_hostname
Catalyst 2960-X Switch Security Configuration Guide, Cisco IOS Release 15.0(2)EX
OL-29048-01 5
Configuring Secure Shell (SSH)
Configuring the SSH Server
Example:
Switch(config)# ip domain-name
your_domain
Step 5 crypto key generate rsa Enables the SSH server for local and remote authentication on the
Switch and generates an RSA key pair. Generating an RSA key
Example: pair for the Switch automatically enables SSH.
Switch(config)# crypto key generate rsa We recommend that a minimum modulus size of 1024 bits.
When you generate RSA keys, you are prompted to enter a modulus
length. A longer modulus length might be more secure, but it takes
longer to generate and to use.
Note Follow this procedure only if you are configuring the
Switch as an SSH server.
Step 6 end Returns to privileged EXEC mode.
Example:
Switch(config)# end
Example:
Switch# show running-config
Step 8 copy running-config startup-config (Optional) Saves your entries in the configuration file.
Example:
Switch# copy running-config
startup-config
Related Topics
SSH Configuration Guidelines, on page 3
Configuring the Switch for Local Authentication and Authorization
Catalyst 2960-X Switch Security Configuration Guide, Cisco IOS Release 15.0(2)EX
6 OL-29048-01
Configuring Secure Shell (SSH)
Configuring the SSH Server
Note This procedure is only required if you are configuring the Switch as an SSH server.
SUMMARY STEPS
1. enable
2. configure terminal
3. ip ssh version [1 | 2]
4. ip ssh {timeout seconds | authentication-retries number}
5. Use one or both of the following:
• line vtyline_number[ ending_line_number ]
6. end
7. show running-config
8. copy running-config startup-config
DETAILED STEPS
Example:
Switch> enable
Example:
Switch# configure terminal
Step 3 ip ssh version [1 | 2] (Optional) Configures the Switch to run SSH Version 1 or SSH Version
2.
Example: • 1—Configure the Switch to run SSH Version 1.
Switch(config)# ip ssh version 1
• 2—Configure the Switch to run SSH Version 2.
If you do not enter this command or do not specify a keyword, the SSH
server selects the latest SSH version supported by the SSH client. For
example, if the SSH client supports SSHv1 and SSHv2, the SSH server
selects SSHv2.
Catalyst 2960-X Switch Security Configuration Guide, Cisco IOS Release 15.0(2)EX
OL-29048-01 7
Configuring Secure Shell (SSH)
Configuring the SSH Server
Step 5 Use one or both of the following: (Optional) Configures the virtual terminal line settings.
• line • Enters line configuration mode to configure the virtual terminal line
vtyline_number[ ending_line_number ] settings. For line_number and ending_line_number, specify a pair
of lines. The range is 0 to 15.
• transport input ssh
• Specifies that the Switch prevent non-SSH Telnet connections. This
limits the router to only SSH connections.
Example:
Switch(config)# line vty 1 10
or
Switch(config-line)# transport input
ssh
Example:
Switch(config-line)# end
Example:
Switch# show running-config
Step 8 copy running-config startup-config (Optional) Saves your entries in the configuration file.
Example:
Switch# copy running-config
startup-config
Catalyst 2960-X Switch Security Configuration Guide, Cisco IOS Release 15.0(2)EX
8 OL-29048-01
Configuring Secure Shell (SSH)
Monitoring the SSH Configuration and Status
Table 1: Commands for Displaying the SSH Server Configuration and Status
Command Purpose
show ip ssh Shows the version and configuration information for
the SSH server.
Additional References
Related Documents
Configuring RADIUS, TACACS+, Secure Shell, Securing User Services Configuration Guide Library,
802.1X and AAA. Cisco IOS XE Release 3SE (Catalyst 3850 Switches)
http://www.cisco.com/en/US/docs/ios-xml/ios/
security/config_library/xe-3se/3850/
secuser-xe-3se-3850-library.html
Description Link
To help you research and resolve system error https://www.cisco.com/cgi-bin/Support/Errordecoder/
messages in this release, use the Error Message index.cgi
Decoder tool.
Standard/RFC Title
Catalyst 2960-X Switch Security Configuration Guide, Cisco IOS Release 15.0(2)EX
OL-29048-01 9
Configuring Secure Shell (SSH)
Feature Information for SSH
MIBs
Technical Assistance
Description Link
The Cisco Support website provides extensive online http://www.cisco.com/support
resources, including documentation and tools for
troubleshooting and resolving technical issues with
Cisco products and technologies.
To receive security and technical information about
your products, you can subscribe to various services,
such as the Product Alert Tool (accessed from Field
Notices), the Cisco Technical Services Newsletter,
and Really Simple Syndication (RSS) Feeds.
Access to most tools on the Cisco Support website
requires a Cisco.com user ID and password.
Catalyst 2960-X Switch Security Configuration Guide, Cisco IOS Release 15.0(2)EX
10 OL-29048-01
Configuring Secure Shell (SSH)
Feature Information for SSH
Catalyst 2960-X Switch Security Configuration Guide, Cisco IOS Release 15.0(2)EX
OL-29048-01 11
Configuring Secure Shell (SSH)
Feature Information for SSH
Catalyst 2960-X Switch Security Configuration Guide, Cisco IOS Release 15.0(2)EX
12 OL-29048-01