Cisco路由器中Telnet, Console, AUX口login命令的含義

來源:互聯網
上載者:User

標籤:password   中文解釋   路由器   實驗室   cisco   

Slyar-route(config)#line console 0
Slyar-route(config-line)#password slyar.com
Slyar-route(config-line)#login
Slyar-route(config-line)#exit

Slyar-route(config)#line vty 0 4
Slyar-route(config-line)#password slyar.com
Slyar-route(config-line)#login
Slyar-route(config-line)#exit

類似的命令都很熟悉了,不過這裡的"login"是什麼意思呢?有人會問console口也需要"login"嗎?

我在很多CISCO的論壇,例如"菊花"、"CCIE實驗室"、"chinaitlab"看到很多人詢問這個問題,但是下面給出的答案層出不窮,但沒有一個能夠給出確切的答案,大多數都是似是而非,告訴你"加上就沒錯",這算什麼...

我去CISCO的Document查了一下資料,發現其實CISCO早就解釋了這個問題,這裡我明確用中文解釋一下。

Document ID: 45843

To specify a password on a line, use the password command in line configuration mode. To enable password checking at login, use the login command in line configuration mode.

Under the line console configuration, login is a required configuration command to enable password checking at login. Console authentication requires both the password and the login commands to work.

要在一個line上定義密碼,需要在全域配置模式下使用password命令,而且需要使用login命令來啟用登入時密碼檢查機制。

在line console的配置下,使用login命令啟用登陸密碼檢查機制是必須的,console口的認證需要password命令和login命令共同使用才會生效。

PS.後來查到一點,有一些特殊版本的VTY會自動在最後增加login命令,這也是一些人提出不敲login命令也可以生效的緣故,但我還是建議按照CISCO官方要求,password命令和login命令共同使用。


login 與 login local的區別

  • no login 不需要輸入密碼直接進入使用者模式

  • login是開啟遠程登入密碼驗證

  • login local不僅要求提供密碼,還要求提供使用者名稱才可以登入。

如果同時設定了login和login local, login local將優先於login,也就是說login local生效。

CQ-YB-R3640-001(config)#line vty 0 4            # 啟用vty線路,允許0-4共5條線路CQ-YB-R3640-001(config-line)#password cisco     # 配置密碼CQ-YB-R3640-001(config-line)#login              # 啟用身分識別驗證CQ-YB-R3640-001(config-line)#

login的意思是啟用身分識別驗證,如果忘了執行命令login,那麼將不進行身分識別驗證,是可以直接登入的,即使設定了密碼。

舉個很形象的例子吧:假設我有一道防盜門,需要驗證密碼才能開啟,我現在對其設定了密碼,但是我並沒有啟動防盜門驗證密碼的機制(沒有給密碼驗證器 加電),所以大家都可以開啟了。


CQ-YB-R3640-001(config)#line vty 0 4       CQ-YB-R3640-001(config-line)#login local        # 注意這裡變為: login local

當我們再次使用 telnet 串連時,會提示輸入 Username:

User Access VerificationUsername: adminPassword:

此時,我們應該還需要提供使用者名稱才可以,下面給出完整的配置

配置過程

1、在全域配置模式下,配置允許對路由器訪問的使用者名稱及密碼

CQ-YB-R3640-001#configure terminalEnter configuration commands, one per line.  End with CNTL/Z.CQ-YB-R3640-001(config)#username admin password cisco

2、切換到線路配置模式,並開啟本地驗證

CQ-YB-R3640-001(config)#line vty 0 4CQ-YB-R3640-001(config-line)#login local

3、退出配置模式

CQ-YB-R3640-001(config-line)#endCQ-YB-R3640-001#*Mar  1 01:52:51.283: %SYS-5-CONFIG_I: Configured from console by console

4、檢查配置

CQ-YB-R3640-001#show running-configBuilding configuration...!username admin password 0 cisco!!line vty 0 4 login local!

5、測試此配置,必須通過telnet遠端連線路由器。



文章來源:Slyar Home (www.slyar.com) 

參考:

http://www.slyar.com/blog/cisco-line-console-vty-login.html


本文出自 “Share your knowledge” 部落格,請務必保留此出處http://skypegnu1.blog.51cto.com/8991766/1570895

Cisco路由器中Telnet, Console, AUX口login命令的含義

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.