Feedback
|
Table Of Contents
Prerequisites for Configuring SSH
Restrictions for Configuring SSH
Information About Secure Shell
Configuration Examples for SSH
Example: SSH on a Cisco 7200 Series Router
Example: SSH on a Cisco 7500 Series Router
Example: SSH on a Cisco 12000 Series Router
Feature Information for Configuring Secure Shell
Configuring Secure Shell
First Published: December 12, 2004Last Updated: April 5, 2010The Secure Shell (SSH) feature is an application and a protocol that provides 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. Two versions of SSH are 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 software image support. To access Cisco Feature Navigator, go to http://www.cisco.com/go/cfn. An account on Cisco.com is not required.
Contents
•
Prerequisites for Configuring SSH
•
Restrictions for Configuring SSH
•
Information About Secure Shell
•
Configuration Examples for SSH
•
Feature Information for Configuring Secure Shell
Prerequisites for Configuring SSH
Perform the following tasks before configuring SSH:
•
Download the required image on the router. The SSH server requires an IPsec (Data Encryption Standard [DES] or 3DES) encryption software image from Cisco IOS Release 12.1(1)T or a later release; the SSH client requires an IPsec (DES or 3DES) encryption software image from Cisco IOS Release 12.1(3)T or a later release.) See the Cisco IOS Configuration Fundamentals Configuration Guide for more information on downloading a software image.
•
Configure a hostname and host domain for your router by using the hostname and ip domain-name commands in global configuration mode.
•
Generate a Rivest, Shamir and Adleman (RSA) key pair for your router. This key pair automatically enables SSH and remote authentication when the crypto key generate rsa command is entered 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 authentication, authorization, and accounting (AAA). For more information, see the "Configuring Authentication," "Configuring Authorization," and "Configuring Accounting" feature modules for more information.
Restrictions for Configuring SSH
SSH has the following restrictions:
•
The 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
Note
Hereafter, unless otherwise noted, the term "SSH" denotes "SSH Version 1" only.
SSH Server
The SSH Server feature enables an 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 thats runs 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 that is 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 secure communication over an insecure network.
The SSH client in Cisco IOS software works with publicly and commercially available SSH servers. The SSH client supports the ciphers of 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 usernames and passwords.
Note
The SSH client functionality is available only when the SSH server is enabled.
RSA Authentication Support
RSA authentication available in SSH clients is not supported on the SSH server for Cisco IOS software by default. See the "Configuring a Router for SSH Version 2 Using Private Public Key Pairs" section of the "Secure Shell Version 2 Support" chapter for the procedure to configure RSA authentication support.
How to Configure SSH
•
Configuring an SSH Server (required)
•
Invoking an SSH Client (optional)
Note
Hereafter, unless otherwise noted, the term "SSH" denotes "SSH Version 1" only.
Configuring an SSH Server
Perform the following steps to configure an SSH server. This task helps you 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
Invoking an SSH Client
Perform this task to invoke an SSH client.
SUMMARY STEPS
1.
enable
2.
ssh -l username -vrf vrf-name ip-address
DETAILED STEPS
Troubleshooting Tips
•
If your SSH configuration commands are rejected as illegal commands, you have not successfully generated an RSA key pair for your router. Make sure that you have specified a hostname and domain. Then use the crypto key generate rsa command to generate an 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 hostname 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-config EXEC command on a Cisco 7200, Cisco 7500, and Cisco 12000 routers.
•
Example: SSH on a Cisco 7200 Series Router
•
Example: SSH on a Cisco 7500 Series Router
•
Example: SSH on a Cisco 12000 Series Router
Note
Hereafter, unless otherwise noted, the term "SSH" denotes "SSH Version 1" only.
Note
The crypto key generate rsa command is not displayed in the show running-config output.
Example: SSH on a Cisco 7200 Series Router
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. Before the SSH server feature is configured on the router, TACACS+ is specified as the method of authentication.
hostname Router72Kaaa new-modelaaa authentication login default tacacs+aaa authentication login aaa7200kw noneenable password passwordusername username1 password 0 password1username username2 password 0 password2ip subnet-zerono ip domain-lookupip domain-name cisco.com! Enter the ssh commands.ip ssh timeout 60ip ssh authentication-retries 2controller E1 2/0controller E1 2/1interface Ethernet1/0ip address 192.168.110.2 255.255.255.0 secondaryip address 192.168.109.2 255.255.255.0no ip directed-broadcastno ip route-cacheno ip mroute-cacheno keepaliveno cdp enableinterface Ethernet1/1no ip addressno ip directed-broadcastno ip route-cacheno ip mroute-cacheshutdownno cdp enableinterface Ethernet1/2no ip addressno ip directed-broadcastno ip route-cacheno ip mroute-cacheshutdownno cdp enableno ip classlessip route 192.168.1.0 255.255.255.0 10.1.10.1ip route 192.168.9.0 255.255.255.0 10.1.1.1ip route 192.168.10.0 255.255.255.0 10.1.1.1map-list atmip 10.1.10.1 atm-vc 7 broadcastno cdp runtacacs-server host 192.168.109.216 port 9000tacacs-server key ciscoradius-server host 192.168.109.216 auth-port 1650 acct-port 1651radius-server key ciscoline con 0exec-timeout 0 0login authentication aaa7200kwtransport input noneline aux 0line vty 0 4password passwordendExample: SSH on a Cisco 7500 Series Router
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.
hostname Router75Kaaa new-modelaaa authentication login default radiusaaa authentication login aaa7500kw noneenable password passwordusername username1 password 0 password1username username2 password 0 password2ip subnet-zerono ip cefno ip domain-lookupip domain-name cisco.com! Enter ssh commands.ip ssh timeout 60ip ssh authentication-retries 5controller E1 3/0channel-group 0 timeslots 1controller E1 3/1channel-group 0 timeslots 1channel-group 1 timeslots 2interface Ethernet0/0/0no ip addressno ip directed-broadcastno ip route-cache distributedshutdowninterface Ethernet0/0/1no ip addressno ip directed-broadcastno ip route-cache distributedshutdowninterface Ethernet0/0/2no ip addressno ip directed-broadcastno ip route-cache distributedshutdowninterface Ethernet0/0/3no ip addressno ip directed-broadcastno ip route-cache distributedshutdowninterface Ethernet1/0ip address 192.168.110.2 255.255.255.0 secondaryip address 192.168.109.2 255.255.255.0no ip directed-broadcastno ip route-cacheno ip mroute-cacheinterface Ethernet1/1ip address 192.168.109.2 255.255.255.0no ip directed-broadcastno ip route-cacheno ip mroute-cacheshutdowninterface Ethernet1/2no ip addressno ip directed-broadcastno ip route-cacheno ip mroute-cacheinterface Ethernet1/3no ip addressno ip directed-broadcastno ip route-cacheno ip mroute-cacheshutdowninterface Ethernet1/4no ip addressno ip directed-broadcastno ip route-cacheno ip mroute-cacheshutdowninterface Ethernet1/5no ip addressno ip directed-broadcastno ip route-cacheno ip mroute-cacheshutdowninterface Serial2/0ip address 10.1.1.2 255.0.0.0no ip directed-broadcastencapsulation pppno ip route-cacheno ip mroute-cacheip classlessip route 192.168.9.0 255.255.255.0 10.1.1.1ip route 192.168.10.0 255.255.255.0 10.1.1.1tacacs-server host 192.168.109.216 port 9000tacacs-server key ciscoradius-server host 192.168.109.216 auth-port 1650 acct-port 1651radius-server key ciscoline con 0exec-timeout 0 0login authentication aaa7500kwtransport input noneline aux 0transport input allline vty 0 4endExample: SSH on a Cisco 12000 Series Router
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 two authentication retries. Before the SSH server feature is configured on the router, TACACS+ is specified as the method of authentication.
hostname Router12Kaaa new-modelaaa authentication login default tacacs+ localaaa authentication login aaa12000kw localenable password passwordusername username1 password 0 password1username username2 password 0 password2redundancymain-cpuauto-sync startup-configip subnet-zerono ip domain-lookupip domain-name cisco.com! Enter ssh commands.ip ssh timeout 60ip ssh authentication-retries 2interface ATM0/0no ip addressno ip directed-broadcastno ip route-cache cefshutdowninterface POS1/0ip address 10.100.100.2 255.255.255.0no ip directed-broadcastencapsulation pppno ip route-cache cefno keepalivecrc 16no cdp enableinterface POS1/1no ip addressno ip directed-broadcastno ip route-cache cefshutdowncrc 32interface POS1/2no ip addressno ip directed-broadcastno ip route-cache cefshutdowncrc 32interface POS1/3no ip addressno ip directed-broadcastno ip route-cache cefshutdowncrc 32interface POS2/0ip address 10.1.1.1 255.255.255.0no ip directed-broadcastencapsulation pppno ip route-cache cefcrc 16interface Ethernet0ip address 172.17.110.91 255.255.255.224no ip directed-broadcastrouter ospf 1network 0.0.0.0 255.255.255.255 area 0.0.0.0ip classlessip route 0.0.0.0 0.0.0.0 172.17.110.65logging trap debuggingtacacs-server host 172.17.116.138tacacs-server key ciscoradius-server host 172.17.116.138 auth-port 1650 acct-port 1651radius-server key ciscoline con 0exec-timeout 0 0login authentication aaa12000kwtransport input noneline aux 0line vty 0 4no scheduler max-task-timeno exception linecard slot 0 sqe-registersno exception linecard slot 1 sqe-registersno exception linecard slot 2 sqe-registersno exception linecard slot 3 sqe-registersno exception linecard slot 4 sqe-registersno exception linecard slot 5 sqe-registersno exception linecard slot 6 sqe-registersendExample: Verifying SSH
To verify that the SSH server is enabled and to display the version and configuration data for your SSH connection, use the show ip ssh command. The following example shows that SSH is enabled:
Router# show ip sshSSH Enabled - version 1.5Authentication timeout: 120 secs; Authentication retries: 3The following example shows that SSH is disabled:
Router# show ip ssh%SSH has not been enabledTo 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:
Router# show sshConnection Version Encryption State Username0 1.5 3DES Session Started guestThe following example shows that SSH is disabled:
Router# show ssh%No SSH server connections running.Additional References
Related Documents
Related Topic Document TitleCisco IOS commands
Authentication, authorization, and accounting (AAA)
•
Configuring Accounting feature module
•
Configuring Authentication feature module
•
Configuring Authorization feature module
IPsec
IPsec and Quality of Service feature module
SSH Version 2
Secure Shell Version 2 Support feature module
Downloading a software image
Standards
Standard TitleNo new or modified standards are supported by this feature, and support for existing standards has not been modified by this feature.
—
MIBs
RFCs
Technical Assistance
Feature Information for Configuring Secure Shell
Table 1 lists the release history for this feature.
Use Cisco Feature Navigator to find information about platform support and software image support. Cisco Feature Navigator enables you to determine which software images support a specific software release, feature set, or platform. To access Cisco Feature Navigator, go to http://www.cisco.com/go/cfn. An account on Cisco.com is not required.
Note
Table 1 lists only the software release that introduced support for a given feature in a given software release train. Unless noted otherwise, subsequent releases of that software release train also support that feature.
Cisco and the Cisco Logo are trademarks of Cisco Systems, Inc. and/or its affiliates in the U.S. and other countries. A listing of Cisco's trademarks can be found at www.cisco.com/go/trademarks. Third party trademarks mentioned 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. (1005R)
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-2010 Cisco Systems, Inc. All rights reserved.
Feedback