1、设置用户名:(这个就不用解释了)
Router(config)#hostname ccna
2、设置域名(在生成加密密码时需要用到用户名和域名):
ccna(config)#ip domain-name opop55.cn
3、为加密会话产生加密密钥:
ccna(config)#crypto key generate rsa
The name for the keys will be: ccna.opop55.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]
4、为SSH会话设置最大空闲定时器(单位为秒):
ccna(config)#ip ssh time-out 60
5、为SSH连接设计最大失败尝试值(次):
ccna(config)#ip ssh authentication-retries 3
6、连接路由器的VTY线路上:
ccna(config)#line vty 0 15
7、最后配置SSH并将Telnet作为访问协议:
ccna(config-line)#transport input ssh telnet
最后一条注明:命令行最后的telnet在PacketTracer上并没有,在实际的路由器上面不知道有没有,具体情况具体对待。
书上作者注明:如果在最后一条命令串不使用关键字telnet那么在路由器上只有SSH可以工作。作者并不建议去尝试使用它们中的任意一个,SSH要比telnet更安全。
|