Center>enable Center# Center#show ip int brief Interface IP-Address OK? Method Status Protocol Ethernet0/0 12.0.0.1 YES manual up up Ethernet1/0 192.168.10.2 YES manual up up Center#ping 192.168.10.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.10.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 4/18/60 ms Center# |
Center#conf t Enter configuration commands, one per line. End with CNTL/Z. Center(config)#username zhanggong secret gongzhang> //配置一个普通的用户,该用户的级别是默认的1,用户级别最大是15,但是使用该用户名,远程登陆之后,只能在用户模式下,并且不对该用户泄漏enable密码,该用户只有对路由器的工作状态监视查看。 Center(config)#username nopassword! privilege 15 secret passwordccie //配置一个高级别的用户,该用户的级别设置为15,即使用本用户和密码远程登陆到路由器能直接进入到特权模式。 //进入VTY线路配置模式 Center(config)#line vty 0 15 //配置本地登陆验证方式,即要求输入用户名和密码,和VTY线路没有任何关系。 Center(config-line)#login local Center(config-line)#end Center# *Mar 1 00:38:38.675: %SYS-5-CONFIG_I: Configured from console by console Center# |
用户名和密码都保持和原来的一致,再次基础之上只需要配置AAA的认证和授权 Center#conf t Enter configuration commands, one per line. End with CNTL/Z. //开启AAA Center(config)#aaa new-model //配置登陆验证方式有aaa 认证来实现,验证方式为本地 Center(config)#aaa authentication login default local Center(config)#aaa authorization ? auth-proxy For Authentication Proxy Services cache For AAA cache configuration commands For exec (shell) commands. config-commands For configuration mode commands. configuration For downloading configurations from AAA server console For enabling console authorization exec For starting an exec (shell). ipmobile For Mobile IP services. network For network services. (PPP, SLIP, ARAP) reverse-access For reverse access connections template Enable template authorization //对本地登陆的用户进行授权,当用户在客户端使用不同的用户名和密码试图登陆,输入的用户名和密码,发送的路由器,路由器查询本地数据库的用户名和密码,如果收到的用户名和密码和本地定义的用户名匹配成功,则用户身份认证通过。完成了认证之后,即使用户的级别是15,因为已经启用了AAA,AAA的安全级别高,要想让这个15级别的用户能进入到特权模式,还必须通过授权来实现。 //配置对exec授权,授权方式为本地 Center(config)#aaa authorization exec default local Center(config)#end |