传统的telnet方式不安全,很容易被别人抓包软件抓到.使用ssh登入cisco设备,比telnet安全多
了.下面是配置步骤.
① 配置hostname和ip domain-name
Router#configure terminal 
Router(config)#hostname test
test(config)#ip domain-name jx.cn.net   -------配置SSH必需  
   
test(config)#username test password 0 test
注:添加一个用户:test,口令:test
test(config)#line vty 0 4
test(config-line)#login local  
test(config-line)#transport input ssh     -----只允许用SSH登录(注意:禁止telnet和从
交换引擎session!)
③ 配置SSH服务:
test(config)#crypto key generate rsax+v
The name for the keys will be: TEST-GSR12008.jx.cn.net
注:SSH的关键字名就是hostname + . +ip domain-name
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 minuts
How many bits in the modulus [512]: 注:选择加密位数,用默认就行了
Generating RSA keys ...
[OK]
用命令show ip ssh也能看到:
SSH Enabled - version 1.5
Authentication timeout: 120 secs; Authentication retries: 
现在SSH服务已经启动,如果需要停止SSH服务,用以下命令:
TEST-GSR12008(config)#crypto key zeroize rsa
④设置SSH参数
配置好了SSH之后,通过show run命令我们看到SSH默认的参数:超时限定为120秒,认证重试次数为3次,可以通过下面命令进行修改:
test(config)#ip ssh {[time-out seconds]} │ [authentication-retries interger]}
如果要把超时限定改为180秒,则应该用:
test(config)# ip ssh time-out 180
如果要把重试次数改成5次,则应该用:
test(config)# ip ssh authentication-retries 
这样,SSH已经在路由器上配置成功了,就能够通过SSH进行安全登录了。

0

收藏

swver

51篇文章,7W+人气,0粉丝

Ctrl+Enter 发布

发布

取消

f92360e227f9d91cdff7ea95120630ef.png
left-qr.jpg

扫一扫,领取大礼包

0

分享
qr-url?url=https%3A%2F%2Fblog.51cto.com%2Fswver%2F67109
swver
noavatar_middle.gif