1、先设置主机名

Router(config)#hostname

Router(config)#hostname R1

R1(config)#

2、设置域名

R1(config)#ip domain-name cisco.com

3、将用户设置为支持ssh客户端接入

R1(config)#username cisco password cisco

4、生成用于保护会话的密钥

R1(config)#cry?

crypto

R1(config)#crypto ?

key          Long term key operations

R1(config)#crypto key ?

generate  Generate new keys

zeroize   Remove keys

R1(config)#crypto key g

R1(config)#crypto key generate ?

rsa  Generate RSA keys

R1(config)#crypto key generate rsa ?

<cr>

R1(config)#crypto key generate rsa

% You already have RSA keys defined named xxxx.cisco.com .

% Do you really want to replace them? [yes/no]: yes

The name for the keys will be: R1.cisco

Choose the size of the key modulus in the range of 360 to 2048 for your

General Purpose Keys. Choosing a key modulus greater than 512 may take

a few minutes.


How many bits in the modulus [512]: 1024

% Generating 1024 bit RSA keys, keys will be non-exportable...[OK]


注意:5,6,7步,PT上都不支持

5、启用ssh的第二版本

R1(config)#ssh version2

6、进入vty线路模式

R1(config)#line vty 0 15

7、讲ssh和telnet作为接入协议

R1(config)#transport input ssh telnet