SSH-----------Secure Shell
 
配置SSH步骤:
1、  双方配置主机名与域名,主机名与域可以不相同
R1(config)#hostname r1
r1(config)#ip domain-name cisco.com
 
R2(config)#hostname r2
r2(config)#ip domain-name cisco.cn
 
2、  双方生成rsa密钥,密钥必须相同
 
r1(config)#crypto key generate rsa
The name for the keys will be: r1.cisco.com
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]
 
r1(config)#
 
r2(config)#crypto key generate rsa
The name for the keys will be: r2.cisco.cn
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]
 
3、  配置用户名和密码
r1(config)#username cisco password cisco
4、  VTY下开启SSH远程登录
 
r1(config)#line vty 0 4
r1(config-line)#login local
r1(config-line)#transport input ssh telnet
r1(config-line)#exit