使用command-privilege给H3C、华为设备的用户账号受权

1、H3C设备的权限默认分为0-3这四种级别shell

数值越小,用户的级别越低
(1)访问权限0 级 : ping、tracert、telnet 等网络诊断小程序,不能够dis current
(2)监控权限 1级: dis current、reset、可开debug这种高级系统诊断工具,能进入system视图进行配置,命令不能保存小程序

(3)系统权限2级 :能够配置除升级版本外的几乎全部业务配置命令,包括建立用户等,能够保存
(4)管理权限3级:关系到系统的基本运行、系统支撑模块功能的命令,这些命令对业务提供支撑做用。包括文件系统、FTP、TFTP、XModem
 
可使用user privilege level命令来设置用户账号登录时的级别
 

2、如何扩展低级别的命令呢?网络

 

修改命令级别的方法就是在系统视图下执行"command-privilege level level view view command"命令。可以使用"undo command-privilege view view command"恢复默认状况。默认状况,各个视图下的每条命令都有指定的级别。命令中的参数说明以下: ide

level level:把后面指定的命令修改到的级别,取值范围为0~3 工具

view view:指定能够执行后面指定的命令的命令行视图名称,view的取值中shell表示用户视图, 用户模式提示符为> 。该参数必须是command所在的视图。学习

command:指定须要修改命令级别的命令。ui

 例如给权限0的用户debugging权限的命令:
能够在系统模式下用:command-privilege level 0 view shell debuggingspa

3、我给机构IT人员分配了level 1的基本权限用于操做H3C S3100二层交换机,并附加以下命令命令行

command-privilege level 1 view shell system-view 
    
在用户模式(shell)下可使用system命令进行系统视图
   
   
   
   

   
   
   
   
       
   

   
   
   
   
       
   
command-privilege level 1 view system quit 
    
system系统视图模式下将quit命令定义为可执行,不然不能退到用户(shell)模式
   
   
   
   

   
   
   
   
       
   
command-privilege level 1 view system save
command-privilege level 1 view shell save
受权level 1在用户模式和system模式均可以save
   
   
   
   

   
   
   
   
       
   

   
   
   
   
       
   
command-privilege level 1 view system interface 
    

受权level 1system系统视图模式下能够进入interface接口。debug


   
   
   
   
       
   

   
   
   
   
       
   
command-privilege level 1 view system interface Ethernet
command-privilege level 1 view ethernet quit

受权level 1system系统视图模式下能够进入interface ethernet接口.
若是不配置ethernet quit,则用户在ethernet接口模式下使用quit会直接退回到用户模式(提示符为>),而不是退回system系统视图

 


   
   
   
   
       
   
command-privilege level 1 view system interface Ethernet 1/0/1
command-privilege level 1 view system interface Ethernet1/0/1

两条命令仅有一个空格的区别,但建议同时写如上两条,以方便进入接口。虽然只写了eth1/0/1这一个接口,但同时能够对其余的ethernet端口进行,包括GigabitEthernet光接口都可以进入

 


   
   
   
   
       
   
command-privilege level 1 view ethernet shutdown
command-privilege level 1 view ethernet undo
command-privilege level 1 view ethernet undo shutdown

受权level 1ethernet接口模式下能够对进行shutdownundo shut操做,GigabitEthernet光接口则不能够


   
   
   
   
       
   
command-privilege level 1 view ethernet mac-address 
    
 command-privilege level 1 view ethernet mac-address max-mac-count 
    
 command-privilege level 1 view ethernet mac-address max-mac-count 1 
    
 command-privilege level 1 view ethernet undo 
    
command-privilege level 1 view ethernet undo mac-address 
    
 command-privilege level 1 view ethernet undo mac-address max-mac-count 
    

受权level 1ethernet接口模式下能够限制该端口学习到的mac地址数

 

 

command-privilege level 1 view ethernet mac-address 
    
command-privilege level 1 view ethernet mac-address static 
    
command-privilege level 1 view ethernet mac-address static 0000-5e00-0001 
    
command-privilege level 1 view ethernet mac-address static 0000-5e00-0001 vlan 
    
command-privilege level 1 view ethernet mac-address static 0000-5e00-0001 vlan 70 
    
command-privilege level 1 view ethernet undo mac-address        
    
command-privilege level 1 view ethernet undo mac-address static 
    
command-privilege level 1 view ethernet undo mac-address static 0000-5e00-0001 
    
command-privilege level 1 view ethernet undo mac-address static 0000-5e00-0001 vlan 
    
command-privilege level 1 view ethernet undo mac-address static 0000-5e00-0001 vlan 70 
    
受权level 1ethernet接口视图下可静态绑定mac地址到指定的端口、vlan
   
   
   
   

 

 

command-privilege level 1 view ethernet mac-address 
    
command-privilege level 1 view system mac-address static 
    
 command-privilege level 1 view system mac-address static 0000-5e00-0000 
    
 command-privilege level 1 view system mac-address static 0000-5e00-0000 interface 
    
 command-privilege level 1 view system mac-address static 0000-5e00-0000 interface Ethernet 
    
 command-privilege level 1 view system mac-address static 0000-5e00-0000 interface Ethernet 1/0/1 
    
 command-privilege level 1 view system mac-address static 0000-5e00-0000 interface Ethernet 1/0/1 vlan 
    
 command-privilege level 1 view system mac-address static 0000-5e00-0000 interface Ethernet 1/0/1 vlan 70 
    
command-privilege level 1 view system undo 
    
command-privilege level 1 view system undo mac-address 
    
 command-privilege level 1 view system undo mac-address static 
    
 command-privilege level 1 view system undo mac-address static 0000-5e00-0000 
    
 command-privilege level 1 view system undo mac-address static 0000-5e00-0000 interface 
    
 command-privilege level 1 view system undo mac-address static 0000-5e00-0000 interface Ethernet 
    
 command-privilege level 1 view system undo mac-address static 0000-5e00-0000 interface Ethernet 1/0/1 
    
 command-privilege level 1 view system undo mac-address static 0000-5e00-0000 interface Ethernet 1/0/1 vlan 
    
 command-privilege level 1 view system undo mac-address static 0000-5e00-0000 interface Ethernet 1/0/1 vlan 70 
    
受权level 1system视图下可静态绑定mac地址到指定的端口、vlan
   
   
   
   

   
   
   
   
       
   

   
   
   
   
       
   
command-privilege level 1 view ethernet line-rate 
    
 command-privilege level 1 view ethernet line-rate inbound 
    
 command-privilege level 1 view ethernet line-rate inbound 64 
    
 command-privilege level 1 view ethernet line-rate outbound 
    
 command-privilege level 1 view ethernet line-rate outbound 64 
    
 command-privilege level 1 view ethernet undo line-rate 
    
 command-privilege level 1 view ethernet undo line-rate inbound 
    
 command-privilege level 1 view ethernet undo line-rate outbound 
    

受权level 1ethernet接口模式下能够限速

 

 

command-privilege level 1 view ethernet speed     
    
command-privilege level 1 view ethernet speed 100 
    
command-privilege level 1 view ethernet speed auto 
    
command-privilege level 1 view ethernet speed 10   
    
command-privilege level 1 view ethernet undo speed 
    

受权level 1ethernet接口模式下能够设定端口速率


   
   
   
   
       
   

   
   
   
   
       
   

   
   
   
   
       
   
 command-privilege level 1 view shell reset
 command-privilege level 1 view shell reset counters
 command-privilege level 1 view shell reset counters interface command-privilege level 1 view shell reset counters interface Ethernet
 command-privilege level 1 view shell reset counters interface Ethernet 1/0/1 
    

受权level 1在用户模式下能够清除计数器

 

command-privilege level 1 view shell reset logbuffer
command-privilege level 1 view shell reset arp
command-privilege level 1 view shell reset stp
command-privilege level 1 view shell reset ndp

受权level 1在用户模式下能够清除日志,清除arp,清除stp,清除ndp

相关文章
相关标签/搜索