一、Console登陆数据库
使用console线链接PC和交换机或路由器,经过超级终端配置端口COM1和链接参数(每秒位数9600,数据位为8,奇偶校验为无,中止位为1,数据流控制为None)。安全
switch(config)#line console 0 #进入控制台口 switch(config-line)#line vty 0 4 #进入虚拟终端 switch(config-line)#password cisco #设置虚拟终端登陆口令cisco switch(config-line)#login #容许登陆 switch#exit #返回命令
二、预配置dom
no ip domain-lookup //关闭主机查询 line vty 0 4 loggin synchronous //开启虚拟接口下的日志同步,避免输入命令被打断 exec-timeout 0 0 //超时时间为0分0秒,即永不超时 no exec-timeout //永不超时,效果同上 no ip http server //关闭http服务 no ip http secure-server //关闭https服务
三、Telnet登陆ssh
Telnet服务默认启用,空密码不支持远程登陆。登陆方式有两种:一、基于密码登陆 二、基于本地数据库登陆
(1)、基于密码登陆,配置Telnet远程登陆密码工具
line vty 0 4 password cisco
(2)、基于本地数据库登陆,配置本地帐号密码加密
username admin password cisco line vty 0 4 login local
必须配置特权密码spa
enable password cisco
enable secret cisco
四、SSH服务日志
SSH服务配置步骤:code
Router#conf t Router(config)#ip domain-name cisco.com //一、启用域名 Router(config)#crypto key generate rsa //二、建立RSA密码,设置加密长度 Router(config)#ip ssh version 2 //三、部署SSH版本 Router(config)#username admin secret cisco //四、配置本地登陆帐户 Router(config)#line vty 0 4 //五、应用到VTY接口 Router(config-line)#transport input ssh //登陆方式为ssh Router(config-line)#login local //认证方式为本地帐号 Router(config)#enable secret cisco //六、配置特权密码
五、Httpserver
思科默认开启Http服务
Router#configure terminal Router(config)#access-list 10 permit 172.25.1.1 Router(config)#access-list 10 deny any Router(config)#ip http server Router(config)#ip http access-class 10 Router(config)#end 注释 因为IOS 12.1(5)以前存在HTTP 访问的高危漏洞,因此若是你的IOS 版本小于此版本建议不要开启此服务 Router(config)#no ip http server 关闭服务
六、Https
开启Https服务
Router(config)#ip http secure-server Router(config)#ip https server 注释 IOS 12.2(14)S 以后引入此特性,建议先用no ip http server 命令关闭非加密的HTTP访问,而后 开启安全的访问,同时可使用ip http secure-port 8080 命令来更改访问端口
七、SDM
SDM(Security Device Manager)是Cisco公司提供的全新图形化路由器管理工具,可安装在PC或路由器中,安装到路由器时基本安装须要大约4-5M Flash空间。
路由器需开启Http或Https服务才能够(平时并不经常使用)。
八、定时重启
颇有用的命令,当你在对路由器配置进行修改前能够先行输入此命令,而后进行修改可是不保存配置,这样能够防止把本身锁在路由器以外。
可使用reload cancel 命令来取消定时重启
Router1#reload in 20 Reload scheduled for 11:33:53 EST Sat Feb 1 2003 (in 20 minutes) Proceed with reload? [confirm] <enter> Router1# Router1#reload at 14:00 Feb 2 Reload scheduled for 14:00:00 EST Sun Feb 2 2003 (in 26 hours and 44 minutes) Proceed with reload? [confirm] <enter> Router1#
九、密码配置
enable密码配置
enable password xxx //配置明文密码 enable secret xxx //配置加密密码
本地用户密码配置
username admin password xxx //明文 username admin secret xxx //密文
service password-encrypition //使全部明文显示的密码加密 security password min-length x //配置最小密码长度,范围为0-6,建议用10)