在Cisco路由器上使用HTTPS会比较有难度,通过HTTPS的连接可以进入特权模式(即我们需要将路由器设置回原始的默认配置状态)。需要用到更
多的命令。
首先,需要开启HTTP/HTTPS服务器(如果你的路由器没有运行在增强服务的IOS上,它将不能支持HTTPS):
Router(config)#ip http server
Router(config)#ip http secure-server
% Generating 1024 bit RSA key, keys will be non-exportable ...[OK]
Router(config)#ip http authentication local
然后,使用特权级别15(最高级别)创建用户帐号:
Router(config)#username cisco privilege 15 password ?
0 Specifies an UNENCRYPTED password will follow
7 Specifies a HIDDEN password will follow
Line The UNENCRYPTED (cleartext) user password
Router(config)#username cisco privilege 15 password 0 cisco
最后,配置控制台、SSH和Telnet,以提供在特权级别访问的本地登录认证:
Router(config)#line console 0
Router(config-line)#login local
Router(config-line)#exit
Router(config)#line vty 0 ?
<1-1180> Last line number
<cr>
Router(config)#line vty 0 1180
Router(config-line)#privilege level 15
Router(config-line)#login local
Router(config-line)#transport input telnet
Router(config-line)#transport input telnet ssh
Router(config-line)#^Z
现在,我们可以使用HTTPS连接到我们的路由器上了