本文档介绍如何为Nexus用户提供受限访问,以便他们只能使用思科安全访问控制服务器(ACS)作为RADIUS服务器输入受限命令。例如,您可能希望用户能够登录到特权或配置模式,并且只能输入接口命令。为此,必须在所使用的RADIUS服务器上为用户创建自定义角色。
RADIUS服务器(本例中的ACS)和Nexus必须能够相互联系并执行身份验证。
本文档中的信息基于以下软件和硬件版本:
本文档中的信息都是基于特定实验室环境中的设备编写的。本文档中使用的所有设备最初均采用原始(默认)配置。如果您使用的是真实网络,请确保您已经了解所有命令的潜在影响。
要创建只为interface命令提供读/写访问权限的角色,请输入:
switch(config)# role name Limited-Access
switch(config-role)# rule 1 permit read-write feature interface
其他允许访问规则使用以下语法定义:
switch(config-role)# rule 1 permit read-write feature snmp
switch(config-role)# rule 2 permit read-write feature snmp
TargetParamsEntry
switch(config-role)# rule 3 permit read-write feature snmp
TargetAddrEntry
Switch(config)#username admin privilege 15 password 0 cisco123!
switch# conf terminal
switch(config)# Radius-server host 10.10.1.1 key cisco123
authenticationaccounting
switch(config)# aaa group server radius RadServer
switch(config-radius)#server 10.10.1.1
switch(config-radius)# use-vrf Management
switch# test aaa server Radius 10.10.1.1 user1 Ur2Gd2BH测试身份验证应会失败,并且服务器会拒绝,因为它尚未配置。但是,它确认服务器可访问。
Switch(config)#aaa authentication login default group Radserver您无需担心本地回退方法,因为如果RADIUS服务器不可用,Nexus会自行回退到本地。
Switch(config)#aaa accounting default group Radserver
Switch(config)#aaa authentication login error-enable
使用本部分可确认配置能否正常运行。
在Nexus上输入show role命令以显示定义的角色和配置的访问规则。
switch# show role (Displays all the roles and includes
custom roles that you have created and their permissions.)
Role: network-admin
Description: Predefined network admin role has access to all
commands on the switch.
-------------------------------------------------------------------
Rule Perm Type Scope Entity
----------------------------------------------------------------
1 permit read-write
Role:Limited_Access
Description: Predefined Limited_Access role has access to these commands.
-------------------------------------------------------------------
Rule Perm Type Scope Entity
-------------------------------------------------------------------
1 permit read-write feature Interface
使用在ACS上配置的用户名和密码登录Nexus。登录后,输入show user-account命令以验证测试用户是否具有Limited_Access角色:
switch# show user-account
user:admin
this user account has no expiry date
roles:network-admin
user:Test
this user account has no expiry date
roles:Limited_Access
确认用户访问角色后,切换到配置模式并尝试输入接口命令以外的命令。应拒绝用户访问。
命令输出解释程序工具(仅限注册用户)支持某些 show 命令。使用输出解释器工具来查看 show 命令输出的分析。
本节提供可用于对交换机配置进行故障排除的信息。
在交换机上完成以下角色分配步骤:
命令输出解释程序工具(仅限注册用户)支持某些 show 命令。使用输出解释器工具来查看 show 命令输出的分析。
版本 | 发布日期 | 备注 |
---|---|---|
1.0 |
11-Jul-2013 |
初始版本 |