2.6. Configuring SSH

Overview

Function Introduction

The Secure Shell (SSH) is a protocol that provides a secure, remote connection to a device. SSH provides more security for remote connections than Telnet does by providing strong encryption when a device is authenticated. SSH supports the Data Encryption Standard (DES) encryption algorithm, the Triple DES (3DES) encryption algorithm, and password-based user authentication. The SSH feature has an SSH server and an SSH integrated client, which are applications that run on the switch. You can use an SSH client to connect to a switch running the SSH server. The SSH server works with the SSH client supported in this release and with SSH clients. The SSH client also works with the SSH server supported in this release and with SSH servers.

Principle Description

N/A

Configuration

Create key for SSH

step 1 Enter the configure mode

Switch# configure terminal

step 2 Create a key

Switch(config)# rsa key a generate

step 3 Create a private key named a.pri with key a and save it to flash

Switch(config)# rsa key a export url flash:/a.pri private ssh2

step 4 Create a private key named a.pub with key a and save it to flash

Switch(config)# rsa key a export url flash:/a.pub public ssh2

step 5 Exit the configure mode

Switch(config)# exit

Import the key

step 1 Enter the configure mode

Switch# configure terminal

step 2 Import the key a.pub we created as importKey

Switch(config)# rsa key importKey import url flash:/a.pub public ssh2

step 3 Create username and password

Switch(config)# username aaa privilege 4 password abc

step 4 Assign the key to user aaa

Switch(config)# username aaa assign rsa key importKey

step 5 Exit the configure mode

Switch(config)# exit

Use SSH to connect

step 1 Download the a.pri key on SSH client

step 2 Connect to the client

[root@testbed012.aq.ru test]# ssh -i a.pri aaa@10.10.39.101
aaa@10.10.39.101's password:
Switch#

Application cases

N/A