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
|