Table Of Contents
Configuring Secure Shell
Finding Feature Information
Contents
Prerequisites
Restrictions
Information About Secure Shell
SSH Server
SSH Integrated Client
How to Configure SSH
Configuring SSH Server
Verifying SSH
Troubleshooting Tips
Configuration Examples for SSH
SSH on a Cisco 7200 Series Router: Example
SSH on a Cisco 7500 Series Router: Example
SSH on a Cisco 1200 Gigabit Switch Router: Example
Additional References
Related Documents
Standards
MIBs
RFCs
Technical Assistance
Feature Information for Configuring Secure Shell
Configuring Secure Shell
First Published: December 12, 2004
Last Updated: September 11, 2009
The Secure Shell (SSH) feature is an application and a protocol that provide a secure replacement to the Berkeley r-tools. The protocol secures the sessions using standard cryptographic mechanisms, and the application can be used similarly to the Berkeley rexec and rsh tools. There are currently two versions of SSH available: SSH Version 1 and SSH Version 2. This document describes SSH Version 1. For information about SSH Version 2, see the "Secure Shell Version 2 Support" feature module.
Note
Hereafter, unless otherwise noted, the term "SSH" denotes "SSH Version 1" only.
Finding Feature Information
Your software release may not support all the features documented in this module. For the latest feature information and caveats, see the release notes for your platform and software release. To find information about the features documented in this module, and to see a list of the releases in which each feature is supported, see the "Feature Information for Configuring Secure Shell" section.
Use Cisco Feature Navigator to find information about platform support and Cisco IOS and Catalyst OS software image support. To access Cisco Feature Navigator, go to http://tools.cisco.com/ITDIT/CFN/jsp/index.jsp. An account on Cisco.com is not required.
Contents
•
Prerequisites
•
Restrictions
•
Information About Secure Shell
•
How to Configure SSH
•
Troubleshooting Tips
•
Configuration Examples for SSH
•
Additional References
•
Feature Information for Configuring Secure Shell
Prerequisites
Perform the following tasks before configuring SSH:
•
Download the required image on the router. (The SSH server requires an IPSec (DES or 3DES) encryption software image from Cisco IOS Release 12.1(1)T or later; the SSH client requires an IPSec (DES or 3DES) encryption software image from Cisco IOS Release 12.1(3)T or later.) See the Cisco IOS Configuration Fundamentals Configuration Guide, Release 12.4T for more information on downloading a software image.
•
Configure a host name and host domain for your router by using the hostname and ip domain-name commands in global configuration mode.
•
Generate an RSA key pair for your router, which automatically enables SSH and remote authentication by entering the crypto key generate rsa command in global configuration mode.
Note
To delete the RSA key-pair, use the crypto key zeroize rsa global configuration command. Once you delete the RSA key-pair, you automatically disable the SSH server.
•
Configure user authentication for local or remote access. You can configure authentication with or without AAA. For more information, see the "Configuring Authentication," "Configuring Authorization," and "Configuring Accounting" feature modules for more information.
Restrictions
SSH has the following restrictions:
•
RSA authentication available in SSH clients is not supported in the SSH server for Cisco IOS software.
•
SSH server and SSH client are supported on DES (56-bit) and 3DES (168-bit) data encryption software images only. In DES software images, DES is the only encryption algorithm available. In 3DES software images, both DES and 3DES encryption algorithms are available.
•
Execution shell is the only application supported.
•
The login banner is not supported in Secure Shell Version 1. It is supported in Secure Shell Version 2.
Information About Secure Shell
The following sections provide information about SSH:
•
SSH Server
•
SSH Integrated Client
SSH Server
The SSH Server feature enables a SSH client to make a secure, encrypted connection to a Cisco router. This connection provides functionality that is similar to that of an inbound Telnet connection. Before SSH, security was limited to Telnet security. SSH allows a strong encryption to be used with the Cisco IOS software authentication. The SSH server in Cisco IOS software works with publicly and commercially available SSH clients.
SSH Integrated Client
The SSH Integrated Client feature is an application running over the SSH protocol to provide device authentication and encryption. The SSH client enables a Cisco router to make a secure, encrypted connection to another Cisco router or to any other device running the SSH server. This connection provides functionality that is similar to that of an outbound Telnet connection except that the connection is encrypted. With authentication and encryption, the SSH client allows for a secure communication over an insecure network.
The SSH client in the Cisco IOS software works with publicly and commercially available SSH servers. The SSH client supports the ciphers of Data Encryption Standard (DES), Triple DES (3DES), and password authentication. User authentication is performed like that in the Telnet session to the router. The user authentication mechanisms supported for SSH are RADIUS, TACACS+ and the use of locally stored user names and passwords.
Note
The SSH client functionality is available only when the SSH server is enabled.
How to Configure SSH
Perform the following tasks for configuring SSH.
•
Configuring SSH Server (Required)
•
Verifying SSH (Optional)
Configuring SSH Server
Perform the following steps to enable the Cisco router for SSH.
Note
The SSH client feature runs in user EXEC mode and has no specific configuration on the router.
Note
The SSH commands are optional and are disabled when the SSH server is disabled. If SSH parameters are not configured, then the default values are used.
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
ip ssh {timeout seconds | authentication-retries integer}
DETAILED STEPS
| |
Command or Action
|
Purpose
|
Step 1
|
enable
Example:
Router> enable
|
Enables privileged EXEC mode.
• Enter your password if prompted.
|
Step 2
|
configure terminal
Example:
Router# configure terminal
|
Enters global configuration mode.
|
Step 3
|
ip ssh {timeout seconds |
authentication-retries integer}
Example:
Router# ip ssh timeout 30
|
(Required) Select one of the SSH control variables.
• The seconds argument specifies the timeout in seconds, not exceeding 120 seconds. The default is 120. This setting applies to the SSH negotiation phase. Once the EXEC session starts, the standard timeouts configured for the vty apply.
By default, there are 5 vtys defined (0-4), therefore 5 terminal sessions are possible. After the SSH executes a shell, the vty timeout starts. The vty timeout defaults to 10 minutes.
• The integer argument specifies the number of authentication retries, not to exceeding 5 authentication retries. The default is 3.
|
Verifying SSH
To verify that the SSH server is enabled and view the version and configuration data for your SSH connection, use the show ip ssh command. The following example shows that SSH is enabled:
SSH Enabled - version 1.5
Authentication timeout: 120 secs; Authentication retries: 3
The following example shows that SSH is disabled:
%SSH has not been enabled
To verify the status of your SSH server connections, use the show ssh command. The following example shows the SSH server connections on the router when SSH is enabled:
Connection Version Encryption State Username
0 1.5 3DES Session Started guest
The following example shows that SSH is disabled:
%No SSH server connections running.
Troubleshooting Tips
•
If your SSH configuration commands are rejected as illegal commands, you have not successfully generated a RSA key pair for your router. Make sure you have specified a host name and domain. Then use the crypto key generate rsa command to generate a RSA key pair and enable the SSH server.
•
When configuring the RSA key pair, you might encounter the following error messages:
–
No hostname specified
You must configure a host name for the router using the hostname global configuration command. See the "IPsec and Quality of Service" feature module for more information.
–
No domain specified
You must configure a host domain for the router using the ip domain-name global configuration command. See the "IPsec and Quality of Service" feature module for more information.
•
The number of allowable SSH connections is limited to the maximum number of vtys configured for the router. Each SSH connection uses a vty resource.
•
SSH uses either local security or the security protocol that is configured through AAA on your router for user authentication. When configuring AAA, you must ensure that AAA is disabled on the console for user authentication. AAA authorization is disabled on the console by default. If AAA authorization is enabled on the console, disable it by configuring the no aaa authorization console command during the AAA configuration stage.
Configuration Examples for SSH
This section provides the following configuration examples, which are output from the show running configuration EXEC command on a Cisco 7200, Cisco 7500, and Cisco 12000.
•
SSH on a Cisco 7200 Series Router: Example
•
SSH on a Cisco 7500 Series Router: Example
•
SSH on a Cisco 1200 Gigabit Switch Router: Example
Note
The crypto key generate rsa command is not displayed in the show running configuration output.
SSH on a Cisco 7200 Series Router: Example
In the following example, SSH is configured on a Cisco 7200 with a timeout that is not to exceed 60 seconds, and no more than 2 authentication retries. Also, before configuring the SSH server feature on the router, TACACS+ is specified as the method of authentication.
aaa authentication login default tacacs+
aaa authentication login aaa7200kw none
enable password enable7200pw
username username1 password 0 password1
username username2 password 0 password2
! Enter the ssh commands.
ip ssh authentication-retries 2
ip address 192.168.110.2 255.255.255.0 secondary
ip address 192.168.109.2 255.255.255.0
ip route 192.168.1.0 255.255.255.0 10.1.10.1
ip route 192.168.9.0 255.255.255.0 10.1.1.1
ip route 192.168.10.0 255.255.255.0 10.1.1.1
ip 10.1.10.1 atm-vc 7 broadcast
tacacs-server host 192.168.109.216 port 9000
radius-server host 192.168.109.216 auth-port 1650 acct-port 1651
login authentication aaa7200kw
SSH on a Cisco 7500 Series Router: Example
In the following example, SSH is configured on a Cisco 7500 with a timeout that is not to exceed 60 seconds and no more than 5 authentication retries. Before the SSH Server feature is configured on the router, RADIUS is specified as the method of authentication.
aaa authentication login default radius
aaa authentication login aaa7500kw none
enable password enable7500pw
username username1 password 0 password1
username username2 password 0 password2
ip ssh authentication-retries 5
channel-group 0 timeslots 1
channel-group 0 timeslots 1
channel-group 1 timeslots 2
no ip route-cache distributed
no ip route-cache distributed
no ip route-cache distributed
no ip route-cache distributed
ip address 192.168.110.2 255.255.255.0 secondary
ip address 192.168.109.2 255.255.255.0
ip address 192.168.109.2 255.255.255.0
ip address 10.1.1.2 255.0.0.0
ip route 192.168.9.0 255.255.255.0 10.1.1.1
ip route 192.168.10.0 255.255.255.0 10.1.1.1
tacacs-server host 192.168.109.216 port 9000
radius-server host 192.168.109.216 auth-port 1650 acct-port 1651
login authentication aaa7500kw
SSH on a Cisco 1200 Gigabit Switch Router: Example
In the following example, SSH is configured on a Cisco 12000 with a timeout that is not to exceed 60 seconds and no more than 2 authentication retries. Before the SSH Server feature is configured on the router, TACACS+ is specified as the method of authentication.
aaa authentication login default tacacs+ local
aaa authentication login aaa12000kw local
enable password enable12000pw
username username1 password 0 password1
username username2 password 0 password2
ip ssh authentication-retries 2
ip address 10.100.100.2 255.255.255.0
ip address 10.1.1.1 255.255.255.0
ip address 172.17.110.91 255.255.255.224
network 0.0.0.0 255.255.255.255 area 0.0.0.0
ip route 0.0.0.0 0.0.0.0 172.17.110.65
tacacs-server host 172.17.116.138
radius-server host 172.17.116.138 auth-port 1650 acct-port 1651
login authentication aaa12000kw
no scheduler max-task-time
no exception linecard slot 0 sqe-registers
no exception linecard slot 1 sqe-registers
no exception linecard slot 2 sqe-registers
no exception linecard slot 3 sqe-registers
no exception linecard slot 4 sqe-registers
no exception linecard slot 5 sqe-registers
no exception linecard slot 6 sqe-registers
Additional References
The following sections provide references related to the SSH feature.
Related Documents
Standards
Standard
|
Title
|
No new or modified standards are supported by this feature, and support for existing standards has not been modified by this feature.
|
—
|
MIBs
MIB
|
MIBs Link
|
No new or modified MIBs are supported by this feature, and support for existing MIBs has not been modified by this feature.
|
To locate and download MIBs for selected platforms, Cisco IOS releases, and feature sets, use Cisco MIB Locator found at the following URL:
http://www.cisco.com/go/mibs
|
RFCs
RFC
|
Title
|
No new or modified RFCs are supported by this feature.
|
—
|
Technical Assistance
Description
|
Link
|
The Cisco Support website provides extensive online 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.
|
http://www.cisco.com/techsupport
|
Feature Information for Configuring Secure Shell
Table 1 lists the release history for this feature.
Not all commands may be available in your Cisco IOS software release. For release information about a specific command, see the command reference documentation.
Use Cisco Feature Navigator to find information about platform support and software image support. Cisco Feature Navigator enables you to determine which Cisco IOS and Catalyst OS software images support a specific software release, feature set, or platform. To access Cisco Feature Navigator, go to http://tools.cisco.com/ITDIT/CFN/jsp/index.jsp. An account on Cisco.com is not required.
Note
Table 1 lists only the Cisco IOS software release that introduced support for a given feature in a given Cisco IOS software release train. Unless noted otherwise, subsequent releases of that Cisco IOS software release train also support that feature.
Table 1 Feature Information for Configuring Secure Shell
Feature Name
|
Releases
|
Feature Information
|
Secure Shell
|
12.0(5)S Cisco IOS XE Release 2.1
|
The Secure Shell (SSH) feature is an application and a protocol that provide a secure replacement to the Berkeley r-tools. The protocol secures the sessions using standard cryptographic mechanisms, and the application can be used similarly to the Berkeley rexec and rsh tools. There are currently two versions of SSH available: SSH Version 1 and SSH Version 2. This document describes SSH Version 1.
This feature was introduced in Cisco IOS Release 12.0(5)S.
This feature was introduced on Cisco ASR 1000 Series Routers.
|
CCDE, CCENT, CCSI, Cisco Eos, Cisco HealthPresence, Cisco Ironport, the Cisco logo, Cisco Lumin, Cisco Nexus, Cisco Nurse Connect, Cisco Stackpower, Cisco StadiumVision, Cisco TelePresence, Cisco Unified Computing System, Cisco WebEx, DCE, Flip Channels, Flip for Good, Flip Mino, Flip Video, Flip Video (Design), Flipshare (Design), Flip Ultra, and Welcome to the Human Network are trademarks; Changing the Way We Work, Live, Play, and Learn, Cisco Store, and Flip Gift Card are service marks; and Access Registrar, Aironet, AsyncOS, Bringing the Meeting To You, Catalyst, CCDA, CCDP, CCIE, CCIP, CCNA, CCNP, CCSP, CCVP, Cisco, the Cisco Certified Internetwork Expert logo, Cisco IOS, Cisco Press, Cisco Systems, Cisco Systems Capital, the Cisco Systems logo, Cisco Unity, Collaboration Without Limitation, EtherFast, EtherSwitch, Event Center, Fast Step, Follow Me Browsing, FormShare, GigaDrive, HomeLink, Internet Quotient, IOS, iPhone, iQuick Study, IronPort, the IronPort logo, LightStream, Linksys, MediaTone, MeetingPlace, MeetingPlace Chime Sound, MGX, Networkers, Networking Academy, Network Registrar, PCNow, PIX, PowerPanels, ProConnect, ScriptShare, SenderBase, SMARTnet, Spectrum Expert, StackWise, The Fastest Way to Increase Your Internet Quotient, TransPath, WebEx, and the WebEx logo are registered trademarks of Cisco Systems, Inc. and/or its affiliates in the United States and certain other countries.
All other trademarks mentioned in this document or website are the property of their respective owners. The use of the word partner does not imply a partnership relationship between Cisco and any other company. (0907R)
Any Internet Protocol (IP) addresses and phone numbers used in this document are not intended to be actual addresses and phone numbers. Any examples, command display output, network topology diagrams, and other figures included in the document are shown for illustrative purposes only. Any use of actual IP addresses or phone numbers in illustrative content is unintentional and coincidental.
© 2004-2009 Cisco Systems, Inc. All rights reserved.