登錄到CISCO路由器的密碼配置區別

登錄到CISCO路由器能夠從如下幾個方式:
一、第一次登錄到路由器必須用到的,經過PC機的CONSOLE口,用一根反轉線鏈接到路由器的CONSOLE口,第一次進去沒有密碼,若是想要給CONSOLE口加一個密碼,命令爲:
Router_A(config)#
Router_A(config)#line console 0
Router_A(config-line)#password cisco4
Router_A(config-line)#login
這樣,咱們經過Console口再次鏈接到路由器上時就要輸入剛纔設置的密碼了。
Press RETURN to get started.
 
User Access Verification
Password:                     (密碼爲cisco4)
Router_A>
 
二、特權密碼,咱們如今已經進入到路由器的用戶模式下面了,在這裏面能夠執行一些查看命令,但不能執行一些關鍵性的命令,好比Show running-config ,進入特權模式能夠設置兩個密碼,一個是明文顯示的,另外一個是加密的(在路由器的清單中不顯示內容),特權密碼是爲了保護特權模式而設的密碼,當同時配置了enable password 和enable secret password 時,後者生效。具體設置爲:
明文的設置方法:
Router_A#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router_A(config)#enable password cisco1
Router_A(config)#
密文的設置方法:
Router_A#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router_A(config)#enable secret password cisco2
Router_A(config)#
使用Show running-config 查看一下,就能夠看到明顯的對比了。
Router_A#show running-config
Building configuration...
Current configuration : 1772 bytes
!
version 12.4
service timestamps log datetime msec
service timestamps debug datetime msec
no service password-encryption
!
hostname Router_A
!
enable secret 5 $1$mERr$P3vLmXozukTrkbTmx/hN50
enable password cisco1
!
當咱們要從用戶模式進入到特權模式時就要輸入剛纔設置的密碼.
Router_A>en
Password:            (密碼爲cisco2)
Router_A#
 
三、爲了能從遠程管理路由器,咱們給路由器設置一個Telnet密碼,這樣咱們就能夠從任何一臺鏈接到此網絡的PC機上管理這臺路由器了。不過在配置密碼以前要先打開一個物理接口,給這個接口配置上地址。
Router_A#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router_A(config)#interface fastethernet 0/0
Router_A(config-if)#ip add 192.168.1.1 255.255.255.0
Router_A(config-if)#no shut
Router_A(config-if)#exit
Router_A(config)#line vty 0 4
Router_A(config-line)#password cisco3      (給telnet上來的用戶設置一個密碼)
Router_A(config-line)#login                           (給telnet上來的用戶返回一個登錄窗口)
Router_A(config-line)#
這樣,咱們在一臺pc機的命令行下面就能夠遠程telnet到這臺路由器上:
C:\>telnet 192.168.1.1
Trying 192.168.1.1 ...Open

User Access Verification
Password:              (密碼爲cisco3)
Router_A>
 
四、若是咱們採用用戶名和密碼的方式給telnet進來的用戶做驗證,就要在配置模式下添加一個用戶。
Router_A#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router_A(config)#user cisco password cisco01
Router_A(config)#line vty 0 4
Router_A(config-line)#login local
Router_A(config-line)#
要採用本地認證的方式纔會使用用戶名和密碼一塊兒來認證。而後咱們再經過telnet 登錄到這臺路由器上來。
PC>telnet 192.168.1.1
Trying 192.168.1.1 ...Open

User Access Verification
Username: cisco
Password:                  (密碼爲cisco01)   
Router_A#
config terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router_A(config)#
這時咱們看到,採起用戶名和密碼方式的驗證經過後直接進入到特權模式,咱們設置的enable secret 沒有起到做用,若是在console下啓用本地認證login local也會出現一樣的效果。
Router_A(config)#line console 0
Router_A(config-line)#login local
Router_A(config-line)#end
——————————————————————————————————————
Press RETURN to get started.
 
 
User Access Verification
Username: cisco
Password:                    (密碼爲cisco01)
Router_A#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router_A(config)#
 
路由器支持對全部口令進行加密顯示,實現這個功能的命令是 service 命令的一個子
命令,即 service password encryption ,此命令應在全局配置模式下發出。配置此命令後的 show running config 結果中會出現相似如下內容的顯示:
    line Console 0
    password 7  02050D 4808095 C
    login
 
 
總結:
採用用戶名和密碼驗證的時候會跳過特權模式密碼,這是在之前沒有注意過的,寫上來留着之後上來查看。
相關文章
相關標籤/搜索