Cisco Packet Tracer 思科模拟器SSH配置

一、配置主机名

二、在路由器上创建网络IP域名(不创建域名的话ssh服务不能被启用)

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

三、创建RSA加密秘钥

R1(config)#crypto key generate rsa   创建加密rsa秘钥
The name for the keys will be: R1.zym.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 秘钥长度建议为1024
% Generating 1024 bit RSA keys, keys will be non-exportable...[OK]

四、创建本地用户,以及登录vty的方式

R1(config)#username ZYM password 123456  创建本地用户
​
R1(config)#line v 0 15   进入vty
​
R1(config-line)#transport input ssh   设置vty的登录方式为ssh 
​
R1(config-line)#login local  本地登录 
​
R1(config)#enable secret 123456  为了保证路由器的设备安全,设一个设备的加密密码

五、验证ssh是否生效

R1#ssh -l ZYM 10.12.60.254  登录模式+距离+域名+地址

六、在路由器上配置ssh v2,超时时间设置为20s,重试次数为2次

R1(config)#ip ssh v 2   设置ssh版本2
​
R1(config)#ip ssh time-out 20  设置ssh超时时间
​
R1(config)#ip ssh authentication-retries 2  设置重试次数

七、检查配置

R1(config)#do show ip ssh
SSH Enabled - version 2.0
Authentication timeout: 20 secs; Authentication retries: 2

猜你喜欢

转载自blog.csdn.net/weixin_59507792/article/details/128422476