Cisco網絡裝置對于通路使用者的不同,可以像windows系統裡的賬戶設定一樣,為了系統或裝置的安全差別建立使用者。通過權限的配置設定以實施安全的裝置管理,怎樣在Cisco路由裝置裡面控制相應使用者的通路?那麼我們就需要知道privilege&privilege view 如何配置了。
privilege這東西很簡單也很好玩的,接下來就來做個小實驗吧。
<a target="_blank" href="http://blog.51cto.com/attachment/201011/171513770.jpg"></a>
r1與r2之間網段設定為192.168.1.0/24,左邊為:192。168。1。1 ,右邊為192。168。1。2。
咱先看下privilege的配置吧,需求:需要給chengxi使用者一個四級的密碼ccnp,隻能使用configure terminal 其它指令不執行。
指令:
username chengxi privilege 4 password ccnp
line vty 0 4
login local
exit
enable secret level 4 ccnp
privilege exec level 4 configure terminal
測試(r2------>r1):
<a target="_blank" href="http://blog.51cto.com/attachment/201011/172341514.jpg"></a>
隻能進入全局模式但不能執行任何動作:
那麼privilege 的測試成功了,屬于level 4的使用者隻能使用configure terminal指令。
如果我們在本地轉換使用者級别的話如:enable password level 4 ccie
<a target="_blank" href="http://blog.51cto.com/attachment/201011/205535255.jpg"></a>
那就登入進去就要先需要輸入使能密碼了,上面開始進入level 4的使用者直接enable 4 回車就進入特權模式了,因為他是從r2 telnet r1的,直接認證進入特權模式了。
如果我們要對使用者行為定位更精确的話,可以使用privilege view 來進行角色建立,多個privilege view 可以形成一個superview。。
下面我們就來建立一個privilege view 為A ,使用者名與密碼依舊是chengxi與ccnp。vty 認證也一樣是本地資料庫認證。但是我們要建立privilege view A就先要開啟aaa new-model ,然後再回到EXEC模式下輸入:enable view
提示password: xxxx,輸入level 15級的密碼即可。
如:
<a target="_blank" href="http://blog.51cto.com/attachment/201011/201753393.jpg"></a>
再進入全局模式裡輸入parser view A.就進入了parser view A配置了,你可以設定登入密碼,允許使用的指令或執行的動作。
那麼我們現在要建立特權視圖A,允許在EXEC模式下執行configure terminal ,在接口模式下隻能配置fa0/1。其它配置一律否定。
parser view A
secret rhce
commands interface include shutdown
commands interface include ip address
commands interface include ip
commands interface include no shutdown
commands interface include no ip address
commands interface include no ip
commands interface include no
commands configure include interface
commands exec include configure terminal
commands exec include configure
commands exec include show
commands configure include interface FastEthernet0/1
配置好後我們現在就可以去測試了。
r2---->r1:
<a target="_blank" href="http://blog.51cto.com/attachment/201011/202833751.jpg"></a>
現在我們已經進入了view A裡面了,密碼可不是level 15的密碼了啊,是view A裡定義的那個rhce啊。進去了之後哦,
<a target="_blank" href="http://blog.51cto.com/attachment/201011/203136791.jpg"></a>
看到了吧,其它指令都不可檢測。呵呵。這就是我們“受制于人”的效果啊。另外我還在上一張圖裡面給大家展示了一個小 case。就是alias别名的作用。看到了吧。我把telnet 192.168.1.1也就是r2 telnet r1的指令用一個r2tor1來代替了。。是以在exec裡面隻要輸入r2tor1就可以telnet上r1了。呵呵。這個好玩吧。
本文轉自 Bruce_F5 51CTO部落格,原文連結:http://blog.51cto.com/zenfei/417274