Sec Usr SSH 15 MT Book
Sec Usr SSH 15 MT Book
Americas Headquarters
Cisco Systems, Inc.
170 West Tasman Drive
San Jose, CA 95134-1706
USA
http://www.cisco.com
Tel: 408 526-4000
800 553-NETS (6387)
Fax: 408 527-0883
THE SPECIFICATIONS AND INFORMATION REGARDING THE PRODUCTS IN THIS MANUAL ARE SUBJECT TO CHANGE WITHOUT NOTICE. ALL STATEMENTS,
INFORMATION, AND RECOMMENDATIONS IN THIS MANUAL ARE BELIEVED TO BE ACCURATE BUT ARE PRESENTED WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED. USERS MUST TAKE FULL RESPONSIBILITY FOR THEIR APPLICATION OF ANY PRODUCTS.
THE SOFTWARE LICENSE AND LIMITED WARRANTY FOR THE ACCOMPANYING PRODUCT ARE SET FORTH IN THE INFORMATION PACKET THAT SHIPPED WITH
THE PRODUCT AND ARE INCORPORATED HEREIN BY THIS REFERENCE. IF YOU ARE UNABLE TO LOCATE THE SOFTWARE LICENSE OR LIMITED WARRANTY,
CONTACT YOUR CISCO REPRESENTATIVE FOR A COPY.
The Cisco implementation of TCP header compression is an adaptation of a program developed by the University of California, Berkeley (UCB) as part of UCB's public domain version
of the UNIX operating system. All rights reserved. Copyright © 1981, Regents of the University of California.
NOTWITHSTANDING ANY OTHER WARRANTY HEREIN, ALL DOCUMENT FILES AND SOFTWARE OF THESE SUPPLIERS ARE PROVIDED “AS IS" WITH ALL FAULTS.
CISCO AND THE ABOVE-NAMED SUPPLIERS DISCLAIM ALL WARRANTIES, EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, THOSE OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OR ARISING FROM A COURSE OF DEALING, USAGE, OR TRADE PRACTICE.
IN NO EVENT SHALL CISCO OR ITS SUPPLIERS BE LIABLE FOR ANY INDIRECT, SPECIAL, CONSEQUENTIAL, OR INCIDENTAL DAMAGES, INCLUDING, WITHOUT
LIMITATION, LOST PROFITS OR LOSS OR DAMAGE TO DATA ARISING OUT OF THE USE OR INABILITY TO USE THIS MANUAL, EVEN IF CISCO OR ITS SUPPLIERS
HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
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.
Cisco and the Cisco logo are trademarks or registered trademarks of Cisco and/or its affiliates in the U.S. and other countries. To view a list of Cisco trademarks, go to this URL: http://
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. (1110R)
Example: Configuring IOS SSH Server to Verify User's Digital Certificate for User
Authentication 85
Additional References for X.509v3 Certificates for SSH Authentication 85
Feature Information for X.509v3 Certificates for SSH Authentication 86
Troubleshooting Tips 93
Configuring a Host Key Algorithm for a Cisco IOS SSH Server 94
Troubleshooting Tips 95
Verifying SSH Algorithms for Common Criteria Certification 95
Configuration Examples For SSH Algorithms for Common Criteria Certification 96
Example: Configuring Encryption Key Algorithms for a Cisco IOS SSH Server 96
Example: Configuring Encryption Key Algorithms for a Cisco IOS SSH Client 96
Example: Configuring MAC Algorithms for a Cisco IOS SSH Server 96
Example: Configuring MAC Algorithms for a Cisco IOS SSH Client 96
Example: Configuring Host Key Algorithms for a Cisco IOS SSH Server 97
Additional References for SSH Algorithms for Common Criteria Certification 97
Feature Information for SSH Algorithms for Common Criteria Certification 98
Note Unless otherwise noted, the term “SSH” denotes “SSH Version 1” only.
• Download the required image on the device. The Secure Shell (SSH) server requires an IPsec (Data
Encryption Standard [DES] or 3DES) encryption software image; the SSH client requires an IPsec (DES
or 3DES) encryption software image.) For information about downloading a software image, see the
Loading and Managing System Images Configuration Guide.
• Configure a hostname and host domain for your device by using the hostname and ip domain-name
commands in global configuration mode.
• Generate a Rivest, Shamir, and Adleman (RSA) key pair for your device. 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
Authentication, Authorization, and Accounting Configuration Guide.
Note Unless otherwise noted, the term “SSH” denotes “SSH Version 1” only.
• The Secure Shell (SSH) server and SSH client are supported on Data Encryption Standard (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.
Note Unless otherwise noted, the term “SSH” denotes “SSH Version 1” only.
SSH Server
Note Unless otherwise noted, the term “SSH” denotes “SSH Version 1” only.
The Secure Shell (SSH) Server feature enables an SSH client to make a secure, encrypted connection to a
Cisco device. 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
software authentication. The SSH server in Cisco software works with publicly and commercially available
SSH clients.
Note Unless otherwise noted, the term “SSH” denotes “SSH Version 1” only.
The Secure Shell (SSH) Integrated Client feature is an application that runs over the SSH protocol to provide
device authentication and encryption. The SSH client enables a Cisco device to make a secure, encrypted
connection to another Cisco device or to any other device running the SSH server. This connection provides
functionality 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 unsecured network.
The SSH client in Cisco software works with publicly and commercially available SSH servers. The SSH
client supports the ciphers of Data Encryption Standard (DES), 3DES, and password authentication. User
authentication is performed like that in the Telnet session to the device. 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.
Note Unless otherwise noted, the term “SSH” denotes “SSH Version 1” only.
SUMMARY STEPS
1. enable
2. configure terminal
3. ip ssh {timeout seconds | authentication-retries integer}
4. ip ssh rekey {time time | volume volume}
5. exit
6. show ip ssh
DETAILED STEPS
Example:
Device# configure terminal
Step 3 ip ssh {timeout seconds | Configures Secure Shell (SSH) control parameters.
authentication-retries integer} Note This command can also be used to establish the number of
password prompts provided to the user. The number is the
Example: lower of the following two values:
Device(config)# ip ssh timeout 30 • Value proposed by the client using the ssh -o
numberofpasswordprompt command.
• Value configured on the device using the ip ssh
authentication-retries integercommand, plus one.
Example:
Device(config)# exit
Step 6 show ip ssh (Optional) Verifies that the SSH server is enabled and displays the
version and configuration data for the SSH connection.
Example:
Device# show ip ssh
Note Unless otherwise noted, the term “SSH” denotes “SSH Version 1” only.
Perform this task to invoke the Secure Shell (SSH) client. The SSH client runs in user EXEC mode and has
no specific configuration tasks.
SUMMARY STEPS
1. enable
2. ssh -l username -vrf vrf-name ip-address
DETAILED STEPS
Step 2 ssh -l username -vrf vrf-name ip-address Invokes the SSH client to connect to an IP host or address in
the specified virtual routing and forwarding (VRF) instance.
Example:
Device# ssh -l user1 -vrf vrf1 192.0.2.1
Troubleshooting Tips
Note Unless otherwise noted, the term “SSH” denotes “SSH Version 1” only.
• If your Secure Shell (SSH) configuration commands are rejected as illegal commands, you have not
successfully generated an Rivest, Shamir, and Adleman (RSA) key pair for your device. 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 device using the hostname global configuration command.
See the “IPsec and Quality of Service” module for more information.
• No domain specified.
You must configure a host domain for the device using the ip domain-name global configuration
command. See the “IPsec and Quality of Service” module for more information
• The number of allowable SSH connections is limited to the maximum number of vtys configured for
the device. Each SSH connection uses a vty resource.
• SSH uses either local security or the security protocol that is configured through AAA on your device
for user authentication. When configuring Authentication, Authorization, and Accounting ( 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.
hostname Router72K
aaa new-model
aaa authentication login default tacacs+
aaa authentication login aaa7200kw none
enable password password
username username1 password 0 password1
username username2 password 0 password2
ip subnet-zero
no ip domain-lookup
ip domain-name cisco.com
! Enter the ssh commands.
ip ssh timeout 60
ip ssh authentication-retries 2
controller E1 2/0
controller E1 2/1
interface Ethernet1/0
ip address 192.168.110.2 255.255.255.0 secondary
ip address 192.168.109.2 255.255.255.0
no ip directed-broadcast
no ip route-cache
no ip mroute-cache
no keepalive
no cdp enable
interface Ethernet1/1
no ip address
no ip directed-broadcast
no ip route-cache
no ip mroute-cache
shutdown
no cdp enable
interface Ethernet1/2
no ip address
no ip directed-broadcast
no ip route-cache
no ip mroute-cache
shutdown
no cdp enable
no ip classless
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
map-list atm
ip 10.1.10.1 atm-vc 7 broadcast
no cdp run
tacacs-server host 192.168.109.216 port 9000
tacacs-server key cisco
radius-server host 192.168.109.216 auth-port 1650 acct-port 1651
radius-server key cisco
line con 0
exec-timeout 0 0
login authentication aaa7200kw
transport input none
line aux 0
line vty 0 4
password password
end
hostname Router75K
aaa new-model
aaa authentication login default radius
aaa authentication login aaa7500kw none
enable password password
ip ssh authentication-retries 5
controller E1 3/0
channel-group 0 timeslots 1
controller E1 3/1
channel-group 0 timeslots 1
channel-group 1 timeslots 2
interface Ethernet0/0/0
no ip address
no ip directed-broadcast
no ip route-cache distributed
shutdown
interface Ethernet0/0/1
no ip address
no ip directed-broadcast
no ip route-cache distributed
shutdown
interface Ethernet0/0/2
no ip address
no ip directed-broadcast
no ip route-cache distributed
shutdown
interface Ethernet0/0/3
no ip address
no ip directed-broadcast
no ip route-cache distributed
shutdown
interface Ethernet1/0
ip address 192.168.110.2 255.255.255.0 secondary
ip address 192.168.109.2 255.255.255.0
no ip directed-broadcast
no ip route-cache
no ip mroute-cache
interface Ethernet1/1
ip address 192.168.109.2 255.255.255.0
no ip directed-broadcast
no ip route-cache
no ip mroute-cache
shutdown
interface Ethernet1/2
no ip address
no ip directed-broadcast
no ip route-cache
no ip mroute-cache
interface Ethernet1/3
no ip address
no ip directed-broadcast
no ip route-cache
no ip mroute-cache
shutdown
interface Ethernet1/4
no ip address
no ip directed-broadcast
no ip route-cache
no ip mroute-cache
shutdown
interface Ethernet1/5
no ip address
no ip directed-broadcast
no ip route-cache
no ip mroute-cache
shutdown
interface Serial2/0
ip address 10.1.1.2 255.0.0.0
no ip directed-broadcast
encapsulation ppp
no ip route-cache
no ip mroute-cache
ip classless
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
tacacs-server key cisco
radius-server host 192.168.109.216 auth-port 1650 acct-port 1651
radius-server key cisco
line con 0
exec-timeout 0 0
login authentication aaa7500kw
transport input none
line aux 0
transport input all
line vty 0 4
end
hostname Router12K
aaa new-model
aaa authentication login default tacacs+ local
aaa authentication login aaa12000kw local
enable password password
interface POS1/1
no ip address
no ip directed-broadcast
no ip route-cache cef
shutdown
crc 32
interface POS1/2
no ip address
no ip directed-broadcast
no ip route-cache cef
shutdown
crc 32
interface POS1/3
no ip address
no ip directed-broadcast
no ip route-cache cef
shutdown
crc 32
interface POS2/0
ip address 10.1.1.1 255.255.255.0
no ip directed-broadcast
encapsulation ppp
no ip route-cache cef
crc 16
interface Ethernet0
ip address 172.17.110.91 255.255.255.224
no ip directed-broadcast
router ospf 1
network 0.0.0.0 255.255.255.255 area 0.0.0.0
ip classless
ip route 0.0.0.0 0.0.0.0 172.17.110.65
line con 0
exec-timeout 0 0
login authentication aaa12000kw
transport input none
line aux 0
line vty 0 4
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
end
Note Unless otherwise noted, the term “SSH” denotes “SSH Version 1” only.
To verify that the Secure Shell (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:
Additional References
Related Documents
Technical Assistance
Description Link
The Cisco Support and Documentation website http://www.cisco.com/cisco/web/support/index.html
provides online resources to download documentation,
software, and tools. Use these resources to install and
configure the software and to troubleshoot and resolve
technical issues with Cisco products and technologies.
Access to most tools on the Cisco Support and
Documentation website requires a Cisco.com user ID
and password.
Reverse Telnet
Reverse telnet allows you to telnet to a certain port range and connect to terminal or auxiliary lines. Reverse
telnet has often been used to connect a Cisco device that has many terminal lines to the consoles of other
Cisco devices. Telnet makes it easy to reach the device console from anywhere simply by telnet to the terminal
server on a specific line. This telnet approach can be used to configure a device even if all network connectivity
to that device is disconnected. Reverse telnet also allows modems that are attached to Cisco devices to be
used for dial-out (usually with a rotary device).
Reverse SSH
Reverse telnet can be accomplished using SSH. Unlike reverse telnet, SSH provides for secure connections.
The Reverse SSH Enhancements feature provides you with a simplified method of configuring SSH. Using
this feature, you no longer have to configure a separate line for every terminal or auxiliary line on which you
want to enable SSH. The previous method of configuring reverse SSH limited the number of ports that can
be accessed to 100. The Reverse SSH Enhancements feature removes the port number limitation. For
information on the alternative method of configuring reverse SSH, see How to Configure Reverse SSH
Enhancements, on page 14.”
SUMMARY STEPS
1. enable
2. configure terminal
3. line line-number ending-line-number
4. no exec
5. login authentication listname
6. transport input ssh
7. exit
8. exit
9. ssh -l userid : {number} {ip-address}
DETAILED STEPS
Example:
Device# configure terminal
Step 3 line line-number ending-line-number Identifies a line for configuration and enters line configuration mode.
Example:
Device# line 1 3
Example:
Device(config-line)# no exec
Step 5 login authentication listname Defines a login authentication mechanism for the lines.
Note The authentication method must use a username and
Example: password.
Device(config-line)# login
authentication default
Example:
Device(config-line)# exit
Example:
Device(config)# exit
Step 9 ssh -l userid : {number} {ip-address} Specifies the user ID to use when logging in on the remote
networking device that is running the SSH server.
Example: • userid --User ID.
Device# ssh -l lab:1 router.example.com
• : --Signifies that a port number and terminal IP address will
follow the userid argument.
• number --Terminal or auxiliary line number.
• ip-address --Terminal server IP address.
SUMMARY STEPS
1. enable
2. configure terminal
3. line line-number ending-line-number
4. no exec
5. login authentication listname
6. rotary group
7. transport input ssh
8. exit
9. exit
10. ssh -l userid :rotary {number} {ip-address}
DETAILED STEPS
Example:
Device# configure terminal
Step 3 line line-number ending-line-number Identifies a line for configuration and enters line configuration mode.
Example:
Device# line 1 200
Example:
Device(config-line)# no exec
Step 5 login authentication listname Defines a login authentication mechanism for the lines.
Note The authentication method must use a username and
Example: password.
Device(config-line)# login
authentication default
Step 7 transport input ssh Defines which protocols to use to connect to a specific line of the
device.
Example: • The ssh keyword must be used for the Reverse SSH
Device(config-line)# transport input ssh Enhancements feature.
Example:
Device(config-line)# exit
Example:
Device(config)# exit
Step 10 ssh -l userid :rotary {number} {ip-address} Specifies the user ID to use when logging in on the remote
networking device that is running the SSH server.
Example: • userid --User ID.
Device# ssh -l lab:rotary1
router.example.com • : --Signifies that a port number and terminal IP address will
follow the userid argument.
• number --Terminal or auxiliary line number.
• ip-address --Terminal server IP address.
SUMMARY STEPS
1. enable
2. debug ip ssh client
DETAILED STEPS
Step 2 debug ip ssh client Displays debugging messages for the SSH client.
Example:
Device# debug ip ssh client
SUMMARY STEPS
1. enable
2. debug ip ssh
3. show ssh
4. show line
DETAILED STEPS
Step 2 debug ip ssh Displays debugging messages for the SSH server.
Example:
Device# debug ip ssh
Example:
Device# show ssh
Example:
Device# show line
line 1 3
no exec
login authentication default
transport input ssh
Client Configuration
The following commands configured on the SSH client will form the reverse SSH session with lines 1, 2, and
3, respectively:
line 1 200
no exec
login authentication default
rotary 1
transport input ssh
exit
The following command shows that reverse SSH will connect to the first free line in the rotary group:
Additional References
Related Documents
Related Topic Document Title
Cisco IOS commands Cisco IOS Master Commands List, All Releases
Technical Assistance
Description Link
The Cisco Support and Documentation website http://www.cisco.com/cisco/web/support/index.html
provides online resources to download documentation,
software, and tools. Use these resources to install and
configure the software and to troubleshoot and resolve
technical issues with Cisco products and technologies.
Access to most tools on the Cisco Support and
Documentation website requires a Cisco.com user ID
and password.
• Because SCP relies on SSH for its secure transport, the device must have a Rivest, Shamir, and Adelman
(RSA) key pair.
Note Enable the SCP option while using the pscp.exe file with the Cisco software.
SUMMARY STEPS
1. enable
2. configure terminal
3. aaa new-model
4. aaa authentication login {default | list-name} method1 [ method2... ]
5. aaa authorization {network | exec | commands level | reverse-access | configuration} {default |
list-name} [method1 [ method2... ]]
6. username name [privilege level] password encryption-type encrypted-password
7. ip scp server enable
8. exit
9. show running-config
10. debug ip scp
DETAILED STEPS
Example:
Device# configure terminal
Example:
Device(config)# aaa new-model
Step 4 aaa authentication login {default | list-name} method1 Enables the AAA access control system.
[ method2... ]
Example:
Device(config)# aaa authentication login default
group tacacs+
Step 5 aaa authorization {network | exec | commands level | Sets parameters that restrict user access to a network.
reverse-access | configuration} {default | list-name} Note The exec keyword runs authorization to
[method1 [ method2... ]] determine if the user is allowed to run an EXEC
shell; therefore, you must use the exec keyword
Example: when you configure SCP.
Device(config)# aaa authorization exec default
group tacacs+
Step 6 username name [privilege level] password Establishes a username-based authentication system.
encryption-type encrypted-password Note You may omit this step if a network-based
authentication mechanism, such as TACACS+
Example: or RADIUS, has been configured.
Device(config)# username superuser privilege 2
password 0 superpassword
Example:
Device(config)# ip scp server enable
Example:
Device# show running-config
Example:
Device# debug ip scp
! AAA authentication and authorization must be configured properly in order for SCP to work.
aaa new-model
aaa authentication login default local
aaa authorization exec default local
username user1 privilege 15 password 0 lab
! SSH must be configured and functioning properly.
ip scp server enable
! AAA authentication and authorization must be configured properly in order for SCP to work.
aaa new-model
aaa authentication login default group tacacs+
aaa authorization exec default group tacacs+
! SSH must be configured and functioning properly.
ip scp server enable
Additional References
Related Documents
Authentication and authorization commands Cisco IOS Security Command Reference: Commands
A to C
Technical Assistance
Description Link
The Cisco Support and Documentation website http://www.cisco.com/cisco/web/support/index.html
provides online resources to download documentation,
software, and tools. Use these resources to install and
configure the software and to troubleshoot and resolve
technical issues with Cisco products and technologies.
Access to most tools on the Cisco Support and
Documentation website requires a Cisco.com user ID
and password.
Glossary
AAA—authentication, authorization, and accounting. A framework of security services that provide the
method for identifying users (authentication), for remote access control (authorization), and for collecting and
sending security server information used for billing, auditing, and reporting (accounting).
RCP—remote copy. Relies on Remote Shell (Berkeley r-tools suite) for security; RCP copies files such as
device images and startup configurations to and from devices.
SCP—secure copy. Relies on SSH for security; SCP support allows secure and authenticated copying of
anything that exists in the Cisco IOS File System (IFS). SCP is derived from RCP.
SSH—Secure Shell. An application and protocol that provide a secure replacement for the Berkeley r-tools
suite. The protocol secures the sessions using standard cryptographic mechanisms, and the application can
be used similar to the Berkeley rexec and rsh tools. SSH Version 1 is implemented in the Cisco software.
Note The SSH Version 2 server and the SSH Version 2 client are supported on your Cisco software, depending
on your release. (The SSH client runs both the SSH Version 1 protocol and the SSH Version 2 protocol.
The SSH client is supported in both k8 and k9 images depending on your release.)
For more information about downloading a software image, refer to the Configuration Fundamentals
Configuration Guide.
Note SSH Version 1 is a protocol that has never been defined in a standard. If you do not want your device to
fall back to the undefined protocol (Version 1), you should use the ip ssh version command and specify
Version 2.
The ip ssh rsa keypair-name command enables an SSH connection using the Rivest, Shamir, and Adleman
(RSA) keys that you have configured. Previously, SSH was linked to the first RSA keys that were generated
(that is, SSH was enabled when the first RSA key pair was generated). This behavior still exists, but by using
the ip ssh rsa keypair-name command, you can overcome this behavior. If you configure the ip ssh rsa
keypair-name command with a key pair name, SSH is enabled if the key pair exists or SSH will be enabled
if the key pair is generated later. If you use this command to enable SSH, you are not forced to configure a
hostname and a domain name, which was required in SSH Version 1 of the Cisco software.
Note The login banner is supported in SSH Version 2, but it is not supported in Secure Shell Version 1.
The Cisco SSH implementation has traditionally used 768-bit modulus, but with an increasing need for higher
key sizes to accommodate DH Group 14 (2048 bits) and Group 16 (4096 bits) cryptographic applications, a
message exchange between the client and the server to establish the favored DH group becomes necessary.
The ip ssh dh min size command configures the modulus size on the SSH server. In addition to this, the ssh
command was extended to add VRF awareness to the SSH client-side functionality through which the VRF
instance name in the client is provided with the IP address to look up the correct routing table and establish
a connection.
Debugging was enhanced by modifying SSH debug commands. The debug ip ssh command was extended
to simplify the debugging process. Before the simplification of the debugging process, this command printed
all debug messages related to SSH regardless of what was specifically required. The behavior still exists, but
if you configure the debug ip ssh command with a keyword, messages are limited to information specified
by the keyword.
An SSH user trying to establish credentials provides an encrypted signature using the private key. The signature
and the user’s public key are sent to the SSH server for authentication. The SSH server computes a hash over
the public key provided by the user. The hash is used to determine if the server has a matching entry. If a
match is found, an RSA-based message verification is performed using the public key. Hence, the user is
authenticated or denied access based on the encrypted signature.
Server authentication—While establishing an SSH session, the Cisco SSH client authenticates the SSH server
by using the server host keys available during the key exchange phase. SSH server keys are used to identify
the SSH server. These keys are created at the time of enabling SSH and must be configured on the client.
For server authentication, the Cisco SSH client must assign a host key for each server. When the client tries
to establish an SSH session with a server, the client receives the signature of the server as part of the key
exchange message. If the strict host key checking flag is enabled on the client, the client checks if it has the
host key entry corresponding to the server. If a match is found, the client tries to validate the signature by
using the server host key. If the server is successfully authenticated, the session establishment continues;
otherwise, it is terminated and displays a “Server Authentication Failed” message.
Note Storing public keys on a server uses memory; therefore, the number of public keys configurable on an
SSH server is restricted to ten users, with a maximum of two public keys per user.
Note RSA-based user authentication is supported by the Cisco server, but Cisco clients cannot propose public
key as an authentication method. If the Cisco server receives a request from an open SSH client for
RSA-based authentication, the server accepts the authentication request.
Note For server authentication, configure the RSA public key of the server manually and configure the ip ssh
stricthostkeycheck command on the Cisco SSH client.
Note When you configure the snmp-server host command, the IP address must be the address of the PC that
has the SSH (telnet) client and that has IP connectivity to the SSH server. For an example of an SNMP
trap generation configuration, see the “Example: Setting an SNMP Trap section.
You must also enable SNMP debugging using the debug snmp packet command to display the traps. The
trap information includes information such as the number of bytes sent and the protocol that was used for the
SSH session. For an example of SNMP debugging, see the “ Example: SNMP Debugging section.
For examples of various scenarios in which the SSH Keyboard Interactive Authentication feature has been
automatically enabled, see the “Examples: SSH Keyboard Interactive Authentication, on page 50” section.
Configuring a Device for SSH Version 2 Using a Hostname and Domain Name
SUMMARY STEPS
1. enable
2. configure terminal
3. hostname name
4. ip domain-name name
5. crypto key generate rsa
6. ip ssh [time-out seconds | authentication-retries integer]
7. ip ssh version [1 | 2]
8. exit
DETAILED STEPS
Example:
Device# configure terminal
Example:
Device(config)# hostname cisco7200
Example:
cisco7200(config)# ip domain-name example.com
Step 5 crypto key generate rsa Enables the SSH server for local and remote
authentication.
Example:
cisco7200(config)# crypto key generate rsa
Step 6 ip ssh [time-out seconds | authentication-retries (Optional) Configures SSH control variables on your
integer] device.
Example:
cisco7200(config)# ip ssh time-out 120
Step 7 ip ssh version [1 | 2] (Optional) Specifies the version of SSH to be run on your
device.
Example:
cisco7200(config)# ip ssh version 1
1. enable
2. configure terminal
3. ip ssh rsa keypair-name keypair-name
4. crypto key generate rsa usage-keys label key-label modulus modulus-size
5. ip ssh [time-out seconds | authentication-retries integer]
6. ip ssh version 2
7. exit
DETAILED STEPS
Example:
Device# configure terminal
Step 3 ip ssh rsa keypair-name keypair-name Specifies the RSA key pair to be used for SSH.
Note A Cisco device can have many RSA key
Example: pairs.
Device(config)# ip ssh rsa keypair-name
sshkeys
Step 4 crypto key generate rsa usage-keys label Enables the SSH server for local and remote authentication
key-label modulus modulus-size on the device.
• For SSH Version 2, the modulus size must be at least
Example: 768 bits.
Device(config)# crypto key generate rsa
usage-keys label sshkeys modulus 768 Note To delete the RSA key pair, use the crypto key
zeroize rsa command. When you delete the RSA
key pair, you automatically disable the SSH server.
Step 5 ip ssh [time-out seconds | authentication-retries Configures SSH control variables on your device.
integer]
Example:
Device(config)# ip ssh time-out 12
Step 6 ip ssh version 2 Specifies the version of SSH to be run on the device.
Example:
Device(config)# ip ssh version 2
Step 7 exit Exits global configuration mode and enters privileged EXEC
mode.
Example:
Device(config)# exit
1. enable
2. configure terminal
3. hostname name
4. ip domain-name name
5. crypto key generate rsa
6. ip ssh pubkey-chain
7. username username
8. key-string
9. key-hash key-type key-name
10. end
DETAILED STEPS
Example:
Device# configure terminal
Example:
Device(config)# hostname host1
Step 4 ip domain-name name Defines a default domain name that the Cisco software uses to complete
unqualified hostnames.
Example:
host1(config)# ip domain-name name1
Example:
host1(config)# crypto key generate rsa
Step 6 ip ssh pubkey-chain Configures SSH-RSA keys for user and server authentication on the
SSH server and enters public-key configuration mode.
Example: • The user authentication is successful if the RSA public key stored
host1(config)# ip ssh pubkey-chain on the server is verified with the public or the private key pair
stored on the client.
Step 7 username username Configures the SSH username and enters public-key user configuration
mode.
Example:
host1(conf-ssh-pubkey)# username user1
Step 8 key-string Specifies the RSA public key of the remote peer and enters public-key
data configuration mode.
Example: Note You can obtain the public key value from an open SSH client;
host1(conf-ssh-pubkey-user)# that is, from the .ssh/id_rsa.pub file.
key-string
Step 9 key-hash key-type key-name (Optional) Specifies the SSH key type and version.
• The key type must be ssh-rsa for the configuration of private public
Example: key pairs.
host1(conf-ssh-pubkey-data)# key-hash
ssh-rsa key1 • This step is optional only if the key-string command is configured.
• You must configure either the key-string command or the
key-hash command.
1. enable
2. configure terminal
3. hostname name
4. ip domain-name name
5. crypto key generate rsa
6. ip ssh pubkey-chain
7. server server-name
8. key-string
9. exit
10. key-hash key-type key-name
11. end
12. configure terminal
13. ip ssh stricthostkeycheck
DETAILED STEPS
Example:
Device# configure terminal
Example:
Device(config)# hostname host1
Step 4 ip domain-name name Defines a default domain name that the Cisco software uses to
complete unqualified hostnames.
Example:
host1(config)# ip domain-name name1
Example:
host1(config)# crypto key generate rsa
Step 6 ip ssh pubkey-chain Configures SSH-RSA keys for user and server authentication on the
SSH server and enters public-key configuration mode.
Example:
host1(config)# ip ssh pubkey-chain
Step 7 server server-name Enables the SSH server for public-key authentication on the device
and enters public-key server configuration mode.
Example:
host1(conf-ssh-pubkey)# server server1
Step 8 key-string Specifies the RSA public-key of the remote peer and enters public
key data configuration mode.
Example: Note You can obtain the public key value from an open SSH
host1(conf-ssh-pubkey-server)# client; that is, from the .ssh/id_rsa.pub file.
key-string
Step 9 exit Exits public-key data configuration mode and enters public-key server
configuration mode.
Example:
host1(conf-ssh-pubkey-data)# exit
Step 10 key-hash key-type key-name (Optional) Specifies the SSH key type and version.
Note You can use a hashing software to compute the hash of the
public key string, or you can copy the hash value from
another Cisco device. Entering the public key data using the
key-string command is the preferred way to enter the public
key data for the first time.
Step 11 end Exits public-key server configuration mode and returns to privileged
EXEC mode.
Example:
host1(conf-ssh-pubkey-server)# end
Example:
host1# configure terminal
Note The device with which you want to connect must support a Secure Shell (SSH) server that has an encryption
algorithm that is supported in Cisco software. Also, you need not enable your device. SSH can be run in
disabled mode.
SUMMARY STEPS
DETAILED STEPS
Example:
Device# ssh -v 2 -c aes256-ctr -m hmac-sha1-96 -l user2 10.76.82.24
Troubleshooting Tips
The ip ssh version command can be used for troubleshooting your SSH configuration. By changing versions,
you can determine the SSH version that has a problem.
Note The following task configures the server-side functionality for SCP. This task shows a typical configuration
that allows the device to securely copy files from a remote workstation.
SUMMARY STEPS
1. enable
2. configure terminal
3. aaa new-model
4. aaa authentication login default local
5. aaa authorization exec defaultlocal
6. usernamename privilege privilege-level password password
7. ip ssh time-outseconds
8. ip ssh authentication-retries integer
9. ip scpserverenable
10. exit
11. debug ip scp
DETAILED STEPS
Example:
Device# configure terminal
Example:
Device(config)# aaa new-model
Step 4 aaa authentication login default local Sets AAA authentication at login to use the local username
database for authentication.
Example:
Device(config)# aaa authentication login
default local
Step 5 aaa authorization exec defaultlocal Sets the parameters that restrict user access to a network, runs
the authorization to determine if the user ID is allowed to run
Example: an EXEC shell, and specifies that the system must use the local
database for authorization.
Device(config)# aaa authorization exec
default local
Step 7 ip ssh time-outseconds Sets the time interval (in seconds) that the device waits for the
SSH client to respond.
Example:
Device(config)# ip ssh time-out 120
Step 8 ip ssh authentication-retries integer Sets the number of authentication attempts after which the
interface is reset.
Example:
Device(config)# ip ssh
authentication-retries 3
Step 9 ip scpserverenable Enables the device to securely copy files from a remote
workstation.
Example:
Device(config)# ip scp server enable
Step 10 exit Exits global configuration mode and returns to privileged EXEC
mode.
Example:
Device(config)# exit
Troubleshooting Tips
To troubleshoot SCP authentication problems, use the debug ip scpcommand.
1. enable
2. show ssh
3. exit
DETAILED STEPS
Example:
Device# show ssh
Step 3 exit Exits privileged EXEC mode and returns to user EXEC mode.
Example:
Device# exit
Examples
The following sample output from the show ssh command displays status of various SSH Version 1 and
Version 2 connections for Version 1 and Version 2 connections:
-----------------------------------------------------------------------
Device# show ssh
-------------------------------------------------------------------------
Device# show ssh
-------------------------------------------------------------------------
Device# show ssh
1. enable
2. show ip ssh
3. exit
DETAILED STEPS
Step 2 show ip ssh Displays the version and configuration data for SSH.
Example:
Device# show ip ssh
Step 3 exit Exits privileged EXEC mode and returns to user EXEC mode.
Example:
Device# exit
Examples
The following sample output from the show ip ssh command displays the version of SSH that is enabled, the
authentication timeout values, and the number of authentication retries for Version 1 and Version 2 connections:
-----------------------------------------------------------------------
Device# show ip ssh
------------------------------------------------------------------------
Device# show ip ssh
------------------------------------------------------------------------
Device# show ip ssh
1. enable
2. debug ip ssh
3. debug snmp packet
DETAILED STEPS
Example:
Device# debug ip ssh
Step 3 debug snmp packet Enables debugging of every SNMP packet sent or received
by the device.
Example:
Device# debug snmp packet
Example
The following sample output from the debug ip ssh command shows the connection is an SSH Version 2
connection:
snmp-server
snmp-server host a.b.c.d public tty
Password:
Password:
Password:
Password:
Password:
Password: cisco123
Last login: Tue Dec 6 13:15:21 2005 from 10.76.248.213
user1@courier:~> exit
logout
[Connection to 10.76.248.200 closed by foreign host]
Device1# debug ip ssh client
Password:
*Nov 17 12:50:53.199: SSH0: sent protocol version id SSH-1.99-Cisco-1.25
*Nov 17 12:50:53.199: SSH CLIENT0: protocol version id is - SSH-1.99-Cisco-1.25
*Nov 17 12:50:53.199: SSH CLIENT0: sent protocol version id SSH-1.99-Cisco-1.25
*Nov 17 12:50:53.199: SSH CLIENT0: protocol version exchange successful
*Nov 17 12:50:53.203: SSH0: protocol version id is - SSH-1.99-Cisco-1.25
*Nov 17 12:50:53.335: SSH CLIENT0: key exchange successful and encryption on
*Nov 17 12:50:53.335: SSH2 CLIENT 0: using method keyboard-interactive
Password:
Password:
Password:
*Nov 17 12:51:01.887: SSH2 CLIENT 0: using method password authentication
Password:
Password: lab
Device2>
Password:
Old Password: cisco
New Password: cisco123
Re-enter New password: cisco123
Device2> exit
Password: cisco
Your password has expired.
Enter a new one now.
New Password: cisco123
Re-enter New password: cisco123
Device2> exit
Password:cisco1
Your password has expired.
Enter a new one now.
New Password: cisco
Re-enter New password: cisco12
The New and Re-entered passwords have to be the same.
Try again.
Device2>
Example: Enabling ChPass and Expiring the Password After Three Logins
In the following example, the ChPass feature is enabled and TACACS+ ACS is used as the back-end AAA
server. The password expires after three logins using the SSH keyboard interactive authentication method.
Password: cisco
Device2> exit
Password: cisco
Device2> exit
Password: cisco
Device2> exit
Password: cisco
Your password has expired.
Enter a new one now.
New Password: cisco123
Re-enter New password: cisco123
Device2>
Device2# exit
local.9.2.1.18.2 = lab
*Jul 18 10:18:42.879: SNMP: Packet sent via UDP to 10.0.0.2
Device1#
The following is sample output from the debug ip ssh packet command. The output provides debugging
information about the SSH packet.
Where to Go Next
You have to use a SSH remote device that supports SSH Version 2, and you have to connect to a Cisco device.
Standards
Standards Title
IETF Secure Shell Version 2 Draft Standards Internet Engineering Task Force website
Technical Assistance
Description Link
The Cisco Support and Documentation website http://www.cisco.com/cisco/web/support/index.html
provides online resources to download documentation,
software, and tools. Use these resources to install and
configure the software and to troubleshoot and resolve
technical issues with Cisco products and technologies.
Access to most tools on the Cisco Support and
Documentation website requires a Cisco.com user ID
and password.
Secure Shell Version 2 Client and Cisco IOS 12.0(32)SY The Cisco IOS image was updated
Server Support to provide for the automatic
Cisco IOS 12.3(7)JA
generation of SNMP traps when an
Cisco IOS 12.4(17) SSH session terminates.
Secure Shell Version 2 Cisco IOS 12.2(50)SY The Secure Shell Version 2
Enhancements Enhancements feature includes a
Cisco IOS 12.4(20)T
number of additional capabilities
Cisco IOS 15.1(2)S such as support for VRF-aware
SSH, SSH debug enhancements,
and DH Group 14 and Group 16
exchange support.
In Cisco IOS 15.1(2)S, support was
added for the Cisco 7600 series
router.
Note Only the VRF-aware SSH
feature is supported in
Cisco IOS Release
12.2(50)SY.
The following commands were
introduced or modified: debug ip
ssh, ip ssh dh min size.
Secure Shell Version 2 Cisco IOS 15.0(1)M The Secure Shell Version 2
Enhancements for RSA Keys. Enhancements for RSA Keys
Cisco IOS 15.1(1)S
feature includes a number of
additional capabilities to support
RSA key-based user authentication
for SSH and SSH server host key
storage and verification.
The following commands were
introduced or modified: ip ssh
pubkey-chain, ip ssh
stricthostkeycheck.
The SSH server requires the use of a username and password, which must be defined through the use of a
local username and password, TACACS+, or RADIUS.
Note The SSH Terminal-Line Access feature is available on any image that contains SSH.
Note The session slot command that is used to start a session with a module requires Telnet to be accepted on
the virtual tty (vty) lines. When you restrict vty lines only to SSH, you cannot use the command to
communicate with the modules. This applies to any Cisco IOS device where the user can telnet to a module
on the device.
SUMMARY STEPS
1. enable
2. configure terminal
3. line line-number [ending-line-number]
4. no exec
5. login {local | authentication listname}
6. rotary group
7. transport input {all | ssh}
8. exit
9. ip ssh port portnum rotary group
DETAILED STEPS
Example:
Router# configure terminal
Example:
Router(config-line)# no exec
Step 5 login {local | authentication listname} Defines a login authentication mechanism for the lines.
Note The authentication method must utilize a username and
Example: password.
Router(config-line)# login
authentication default
Step 6 rotary group Defines a group of lines consisting of one or more lines.
Note All rotaries used must be defined, and each defined rotary must
Example: be used when SSH is enabled.
Router(config-line)# rotary 1
Step 7 transport input {all | ssh} Defines which protocols to use to connect to a specific line of the router.
Example:
Router(config-line)# transport input
ssh
Example:
Router(config-line)# exit
Step 9 ip ssh port portnum rotary group Enables secure network access to the tty lines.
• Use this command to connect the portnum argument with the
Example: rotary groupargument, which is associated with a line or group of
Router(config)# ip ssh port 2000 lines.
rotary 1
Note The group argument must correspond with the rotary group
number chosen in Step 6.
line 1 200
no exec
login authentication default
rotary 1
transport input ssh
exit
ip ssh port 2000 rotary 1
2 2002
3 2003
line 1
no exec
login authentication default
rotary 1
transport input ssh
line 2
no exec
login authentication default
rotary 2
transport input ssh
line 3
no exec
login authentication default
rotary 3
transport input ssh
ip ssh port 2001 rotary 1 3
Additional References
Related Documents
Standards
Standard Title
--
MIBs
RFCs
RFC Title
None. --
Technical Assistance
Description Link
The Cisco Support and Documentation website http://www.cisco.com/cisco/web/support/index.html
provides online resources to download documentation,
software, and tools. Use these resources to install and
configure the software and to troubleshoot and resolve
technical issues with Cisco products and technologies.
Access to most tools on the Cisco Support and
Documentation website requires a Cisco.com user ID
and password.
By default, all the user authentication methods are enabled. Use the no ip ssh server authenticate user
{publickey | keyboard | pasword} command to disable any specific user authentication method so that the
disabled method is not negotiated in the SSH user authentication protocol. This feature helps the SSH server
offer any preferred user authentication method in an order different from the predefined order. The disabled
user authentication method can be enabled using the ip ssh server authenticate user {publickey | keyboard
| pasword} command.
As per RFC 4252 (The Secure Shell (SSH) Authentication Protocol), the public-key authentication method
is mandatory. This feature enables the SSH server to override the RFC behavior and disable any SSH user
authentication method, including public-key authentication.
For example, if the SSH server prefers the password authentication method, the SSH server can disable the
public-key and keyboard-interactive authentication methods.
SUMMARY STEPS
1. enable
2. configure terminal
3. no ip ssh server authenticate user {publickey | keyboard | pasword}
4. ip ssh server authenticate user {publickey | keyboard | pasword}
5. default ip ssh server authenticate user
6. end
DETAILED STEPS
Example:
Device# configure terminal
Step 3 no ip ssh server authenticate user {publickey | Disables a user authentication method in the Secure Shell (SSH)
keyboard | pasword} server.
Note A warning message is displayed when the no ip ssh
Example: server authenticate user publickey command is used
to disable public-key authentication. This command
Device(config)# no ip ssh server authenticate overrides the RFC 4252 (The Secure Shell (SSH)
user publickey
Authentication Protocol) behavior, which states that
%SSH:Publickey disabled.Overriding RFC public-key authentication is mandatory.
Step 4 ip ssh server authenticate user {publickey | Enables the disabled user authentication method in the SSH
keyboard | pasword} server.
Example:
Device(config)# ip ssh server authenticate
user publickey
Step 5 default ip ssh server authenticate user Returns to the default behavior in which all user authentication
methods are enabled in the predefined order.
Example:
Device(config)# default ip ssh server
authenticate user
Troubleshooting Tips
• If the public-key-based authentication method is disabled using the no ip ssh server authenticate user
publickey command, the RFC 4252 (The Secure Shell (SSH) Authentication Protocol) behavior in
which public-key authentication is mandatory is overridden and the following warning message is
displayed:
%SSH:Publickey disabled.Overriding RFC
• If all three authentication methods are disabled, the following warning message is displayed:
%SSH:No auth method configured.Incoming connection will be dropped
• In the event of an incoming SSH session request from the SSH client when all three user authentication
methods are disabled on the SSH server, the connection request is dropped at the SSH server and a
system log message is available in the following format:
%SSH-3-NO_USERAUTH: No auth method configured for SSH Server. Incoming connection from
<ip address> (tty = <ttynum>) dropped
1. enable
2. show ip ssh
DETAILED STEPS
Step 1 enable
Enables privileged EXEC mode.
• Enter your password if prompted.
Example:
Device> enable
Displays the version and configuration data for Secure Shell (SSH).
Example:
The following sample output from the show ip ssh command confirms that all three user authentication methods are
enabled in the SSH server:
Device# show ip ssh
Authentication methods:publickey,keyboard-interactive,password
The following sample output from the show ip ssh command confirms that all three user authentication methods are
disabled in the SSH server:
Device# show ip ssh
Authentication methods:NONE
Device> enable
Device# configure terminal
Device(config)# no ip ssh server authenticate user publickey
%SSH:Publickey disabled.Overriding RFC
Device(config)# no ip ssh server authenticate user keyboard
Device(config)# exit
Device> enable
Device# configure terminal
Device(config)# ip ssh server authenticate user publickey
Device(config)# ip ssh server authenticate user keyboard
Device(config)# exit
Device> enable
Device# configure terminal
Device(config)# default ip ssh server authenticate user
Device(config)# exit
Security commands
• Cisco IOS Security Command Reference:
Commands A to C
• Cisco IOS Security Command Reference:
Commands D to L
• Cisco IOS Security Command Reference:
Commands M to R
• Cisco IOS Security Command Reference:
Commands S to Z
Standard/RFC Title
RFC 4252 The Secure Shell (SSH) Authentication Protocol
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.
If the SSH session uses a remote device that does not support the AES-CTR encryption mode, then the
encryption mode for the session falls back to AES-CBC mode.
Note The device with which you want to connect must support an SSH server that has the AES-CTR encryption
algorithm that is supported in Cisco software. SSH can be run even when the device is disabled.
SUMMARY STEPS
1. enable
2. ssh [-v {1 | 2} | -c {aes128-ctr | aes192-ctr | aes256-ctr | aes128-cbc | 3des | aes192-cbc | aes256-cbc} |
-l user-id | -l user-id:vrf-name number ip-address ip-address | -l user-id:rotary number ip-address | -m
{hmac-md5-128 | hmac-md5-96 | hmac-sha1-160 | hmac-sha1-96} | -o numberofpasswordprompts
n | -p port-num] {ip-addr | hostname} [command | -vrf]
3. exit
DETAILED STEPS
Step 2 ssh [-v {1 | 2} | -c {aes128-ctr | aes192-ctr | aes256-ctr | aes128-cbc | Starts an encrypted session with a remote
3des | aes192-cbc | aes256-cbc} | -l user-id | -l user-id:vrf-name number networking device.
ip-address ip-address | -l user-id:rotary number ip-address | -m
{hmac-md5-128 | hmac-md5-96 | hmac-sha1-160 | hmac-sha1-96} |
-o numberofpasswordprompts n | -p port-num] {ip-addr | hostname}
[command | -vrf]
Example:
Device# ssh -v 2 -c aes256-ctr -m hmac-sha1-96 -l user2
10.76.82.24
Example:
Device# exit
1. enable
2. show ssh
3. debug ip ssh detail
DETAILED STEPS
Step 1 enable
Enables privileged EXEC mode.
• Enter your password if prompted.
Example:
Device> enable
Example:
The following sample output from the show ssh command shows that the AES-CTR encryption mode is used for the
session between the SSH server and client:
Device# show ssh
Example:
The following sample output from the debug ip ssh detail command in the SSH server shows that the AES-CTR
encryption mode is used for the session between the SSH server and client:
Device# debug ip ssh detail
The following sample output from the debug ip ssh detail command in the SSH client shows that the AES-CTR encryption
mode is used for the session between the SSH server and client:
Device# debug ip ssh detail
Device> enable
Device# ssh -v 2 -c aes256-ctr -m hmac-sha1-96 -l user2 10.76.82.24
Device# exit
Security commands
• Cisco IOS Security Command Reference:
Commands A to C
• Cisco IOS Security Command Reference:
Commands D to L
• Cisco IOS Security Command Reference:
Commands M to R
• Cisco IOS Security Command Reference:
Commands S to Z
Standard/RFC Title
RFC 4344 The Secure Shell (SSH) Transport Layer Encryption
Modes
Technical Assistance
Description Link
The Cisco Support website provides extensive online http://www.cisco.com/cisco/web/support/index.html
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.
◦Use the default ip ssh server authenticate user command to remove the ip ssh server authenticate
user command from effect. The IOS secure shell (SSH) server then starts using the ip ssh server
algorithm authentication command.
1. enable
2. configure terminal
3. ip ssh server algorithm hostkey {x509v3-ssh-rsa [ssh-rsa] | ssh-rsa [x509v3-ssh-rsa]}
4. ip ssh server certificate profile
5. server
6. trustpoint sign PKI-trustpoint-name
7. ocsp-response include
8. end
DETAILED STEPS
Example:
Device# configure terminal
Step 3 ip ssh server algorithm hostkey Defines the order of host key algorithms. Only the configured
{x509v3-ssh-rsa [ssh-rsa] | ssh-rsa algorithm is negotiated with the secure shell (SSH) client.
[x509v3-ssh-rsa]} Note The IOS SSH server must have at least one configured host
key algorithm:
Example:
• ssh-rsa – public key based authentication
Device(config)# ip ssh server algorithm
hostkey x509v3-ssh-rsa • x509v3-ssh-rsa – certificate-based authentication
Step 4 ip ssh server certificate profile Configures server certificate profile and user certificate profile and
enters SSH certificate profile configuration mode.
Example:
Device(config)# ip ssh server certificate
profile
Step 6 trustpoint sign PKI-trustpoint-name Attaches the public key infrastructure (PKI) trustpoint to the server
certificate profile. The SSH server uses the certificate associated
Example: with this PKI trustpoint for server authentication.
Device(ssh-server-cert-profile-server)#
trustpoint sign trust1
Step 7 ocsp-response include (Optional) Sends the Online Certificate Status Protocol (OCSP)
response or OCSP stapling along with the server certificate.
Example: Note By default the “no” form of this command is configured
Device(ssh-server-cert-profile-server)# and no OCSP response is sent along with the server
ocsp-response include certificate.
Step 8 end Exits SSH server certificate profile server configuration mode and
enters privileged EXEC mode.
Example:
Device(ssh-server-cert-profile-server)#
end
Configuring IOS SSH Server to Verify User's Digital Certificate for User
Authentication
SUMMARY STEPS
1. enable
2. configure terminal
3. ip ssh server algorithm authentication {publickey | keyboard | password}
4. ip ssh server algorithm publickey {x509v3-ssh-rsa [ssh-rsa] | ssh-rsa [x509v3-ssh-rsa]}
5. ip ssh server certificate profile
6. user
7. trustpoint verify PKI-trustpoint-name
8. ocsp-response required
9. end
DETAILED STEPS
Example:
Device# configure terminal
Step 3 ip ssh server algorithm authentication Defines the order of user authentication algorithms. Only the configured
{publickey | keyboard | password} algorithm is negotiated with the secure shell (SSH) client.
Note The IOS SSH server must have at least one configured user
Example: authentication algorithm.
Device(config)# ip ssh server algorithm Note To use the certificate method for user authentication, the
authentication publickey publickey keyword must be configured.
Note The ip ssh server algorithm authentication command
replaces the ip ssh server authenticate user command.
Step 4 ip ssh server algorithm publickey Defines the order of public key algorithms. Only the configured
{x509v3-ssh-rsa [ssh-rsa] | ssh-rsa algorithm is accepted by the SSH client for user authentication.
[x509v3-ssh-rsa]} Note The IOS SSH client must have at least one configured public
key algorithm:
Example:
• ssh-rsa – public-key-based authentication
Device(config)# ip ssh server algorithm
publickey x509v3-ssh-rsa • x509v3-ssh-rsa – certificate-based authentication
Step 5 ip ssh server certificate profile Configures server certificate profile and user certificate profile and
enters SSH certificate profile configuration mode.
Example:
Device(config)# ip ssh server
certificate profile
Step 6 user Configures user certificate profile and enters SSH server certificate
profile user configuration mode.
Example:
Device(ssh-server-cert-profile)# user
Step 7 trustpoint verify PKI-trustpoint-name Configures the public key infrastructure (PKI) trustpoint that is used
to verify the incoming user certificate.
Example: Note Configure multiple trustpoints by executing the same command
Device(ssh-server-cert-profile-user)# multiple times. A maximum of 10 trustpoints can be
trustpoint verify trust2 configured.
Step 9 end Exits SSH server certificate profile user configuration mode and enters
privileged EXEC mode.
Example:
Device(ssh-server-cert-profile-user)#
end
1. enable
2. show ip ssh
DETAILED STEPS
Step 1 enable
Enables privileged EXEC mode.
• Enter your password if prompted.
Example:
Device> enable
Example:
Device# show ip ssh
Hostkey Algorithms:x509v3-ssh-rsa,ssh-rsa
Authentication timeout: 120 secs; Authentication retries: 3
Minimum expected Diffie Hellman key size : 1024 bits
Example: Configuring IOS SSH Server to Verify User's Digital Certificate for
User Authentication
Device> enable
Device# configure terminal
Device(config)# ip ssh server algorithm authentication publickey
Device(config)# ip ssh server algorithm publickey x509v3-ssh-rsa
Device(config)# ip ssh server certificate profile
Device(ssh-server-cert-profile)# user
Device(ssh-server-cert-profile-user)# trustpoint verify trust2
Device(ssh-server-cert-profile-user)# end
Public key infrastructure (PKI) trustpoint “Configuring and Managing a Cisco IOS Certificate
Server for PKI Deployment” chapter in Public Key
Infrastructure Configuration Guide
Technical Assistance
Description Link
The Cisco Support website provides extensive online http://www.cisco.com/cisco/web/support/index.html
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.
Cisco IOS SSH servers support the Message Authentication Code (MAC) algorithms in the following order:
1 hmac-sha1
2 hmac-sha1-96
Cisco IOS SSH servers support the host key algorithms in the following order:
1 x509v3-ssh-rsa
2 ssh-rsa
2 aes192-ctr
3 aes256-ctr
4 aes128-cbc
5 3des-cbc
6 aes192-cbc
7 aes256-cbc
Cisco IOS SSH clients support the Message Authentication Code (MAC) algorithms in the following order:
1 hmac-sha1
2 hmac-sha1-96
Cisco IOS SSH clients support only one host key algorithm and do not need a CLI configuration:
• ssh-rsa
Configuring an Encryption Key Algorithm for a Cisco IOS SSH Server and Client
SUMMARY STEPS
1. enable
2. configure terminal
3. ip ssh {server | client} algorithm encryption {aes128-ctr | aes192-ctr | aes256-ctr | aes128-cbc |
3des-cbc | aes192-cbc | aes256-cbc}
4. end
DETAILED STEPS
Example:
Device# configure terminal
Step 3 ip ssh {server | client} algorithm encryption Defines the order of encryption algorithms in the SSH server and
{aes128-ctr | aes192-ctr | aes256-ctr | aes128-cbc client. This order is presented during algorithm negotiation.
| 3des-cbc | aes192-cbc | aes256-cbc} Note The Cisco IOS SSH server and client must have at least
one configured encryption algorithm.
Example: Note To disable one algorithm from the previously configured
Device(config)# ip ssh server algorithm algorithm list, use the no form of this command. To disable
encryption aes128-ctr aes192-ctr aes256-ctr more than one algorithm, use the no form of this command
aes128-cbc 3des-cbc aes192-cbc aes256-cbc multiple times with different algorithm names.
Device(config)# ip ssh client algorithm Note For a default configuration, use the default form of this
encryption aes128-ctr aes192-ctr aes256-ctr command as shown below:
aes128-cbc 3des-cbc aes192-cbc aes256-cbc
Step 4 end Exits global configuration mode and returns to privileged EXEC
mode.
Example:
Device(config)# end
Troubleshooting Tips
If you try to disable the last encryption algorithm in the configuration, the following message is displayed
and the command is rejected:
Configuring a MAC Algorithm for a Cisco IOS SSH Server and Client
SUMMARY STEPS
1. enable
2. configure terminal
3. ip ssh {server | client} algorithm mac {hmac-sha1 | hmac-sha1-96}
4. end
DETAILED STEPS
Example:
Device# configure terminal
Step 3 ip ssh {server | client} algorithm mac Defines the order of MAC (Message Authentication Code) algorithms in
{hmac-sha1 | hmac-sha1-96} the SSH server and client. This order is presented during algorithm
negotiation.
Example: Note The Cisco IOS SSH server and client must have at least one
Device(config)# ip ssh server configured Hashed Message Authentication Code (HMAC)
algorithm mac hmac-sha1 hmac-sha1-96 algorithm.
Note To disable one algorithm from the previously configured
Device(config)# ip ssh client
algorithm mac hmac-sha1 hmac-sha1-96 algorithm list, use the no form of this command. To disable more
than one algorithm, use the no form of this command multiple
times with different algorithm names.
Note For default configuration, use the default form of this command
as shown below:
Step 4 end Exits global configuration mode and returns to privileged EXEC mode.
Example:
Device(config)# end
Troubleshooting Tips
If you try to disable the last MAC algorithm in the configuration, the following message is displayed and the
command is rejected:
1. enable
2. configure terminal
3. ip ssh server algorithm hostkey {x509v3-ssh-rsa | ssh-rsa}
4. end
DETAILED STEPS
Example:
Device# configure terminal
Step 3 ip ssh server algorithm hostkey Defines the order of host key algorithms. Only the configured algorithm is
{x509v3-ssh-rsa | ssh-rsa} negotiated with the Cisco IOS secure shell (SSH) client.
Note The Cisco IOS SSH server must have at least one configured host
Example: key algorithm:
Device(config)# ip ssh server • x509v3-ssh-rsa—X.509v3 certificate-based authentication
algorithm hostkey x509v3-ssh-rsa
ssh-rsa
• ssh-rsa—Public-key-based authentication
Note To disable one algorithm from the previously configured algorithm
list, use the no form of this command. To disable more than one
algorithm, use the no form of this command multiple times with
different algorithm names.
Note For default configuration, use the default form of this command as
shown below:
Step 4 end Exits global configuration mode and returns to privileged EXEC mode.
Example:
Device(config)# end
Troubleshooting Tips
If you try to disable the last host key algorithm in the configuration, the following message is displayed and
the command is rejected:
1. enable
2. show ip ssh
DETAILED STEPS
Step 1 enable
Enables privileged EXEC mode.
• Enter your password if prompted.
Example:
Device> enable
Example:
The following sample output from the show ip ssh command shows the encryption algorithms configured in the default
order:
Device# show ip ssh
The following sample output from the show ip ssh command shows the MAC algorithms configured in the default order:
Device# show ip ssh
The following sample output from the show ip ssh command shows the host key algorithms configured in the default
order:
Device# show ip ssh
Example: Configuring Encryption Key Algorithms for a Cisco IOS SSH Server
Device> enable
Device# configure terminal
Device(config)# ip ssh server algorithm encryption aes128-ctr aes192-ctr aes256-ctr aes128-cbc
3des-cbc aes192-cbc aes256-cbc
Device(config)# end
Example: Configuring Encryption Key Algorithms for a Cisco IOS SSH Client
Device> enable
Device# configure terminal
Device(config)# ip ssh client algorithm encryption aes128-ctr aes192-ctr aes256-ctr aes128-cbc
3des-cbc aes192-cbc aes256-cbc
Device(config)# end
Example: Configuring Host Key Algorithms for a Cisco IOS SSH Server
Device> enable
Device# configure terminal
Device(config)# ip ssh server algorithm hostkey x509v3-ssh-rsa ssh-rsa
Device(config)# end
Security commands
• Cisco IOS Security Command Reference:
Commands A to C
• Cisco IOS Security Command Reference:
Commands D to L
• Cisco IOS Security Command Reference:
Commands M to R
• Cisco IOS Security Command Reference:
Commands S to Z
X.509v3 digital certificates in server and user “X.509v3 Certificates for SSH Authentication” chapter
authentication in the Secure Shell Configuration Guide
Technical Assistance
Description Link
The Cisco Support website provides extensive online http://www.cisco.com/cisco/web/support/index.html
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.
Table 10: Feature Information for SSH Algorithms for Common Criteria Certification