亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

跪求解釋,為何ssh登陸密碼不正確?!

跪求解釋,為何ssh登陸密碼不正確?!

jeck貓 2019-02-14 15:11:58
跪求高手解釋,為何ssh登陸密碼不正確?!
查看完整描述

1 回答

?
人到中年有點甜

TA貢獻1895條經驗 獲得超7個贊

不過還是告訴你真正的原因好了= =

緣起...請上網找尋Cisco的文件編號: 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.

里面解釋了這件事...

首先你要知道
login是做啥用的
在Cisco設備上的解釋是 Enable password checking
(你用? 去看設備上login的解釋)
表示在...啟用密碼檢查(當登入時,在這條連線上啟用密碼認證)

而loing local當中的local是何意思呢?
請看設備上的解釋... local Local password checking
表示使用本機上的密碼作認證

那重點來了...
line vty 0 4
login
transport input ssh
transport output none
通過遠程ssh總提示密碼不對

因為你只下了login
告訴switch在line vty 0 4啟用密碼驗證
但是...問題是...你沒有告訴它用何種方法來驗證?
所以你即便輸入了正確的密碼....它還是告訴你『密碼不對』
因為它沒有一個依據來跟你輸入的密碼作比對,所以...你永遠只會得到....密碼不對
正確密碼 & null 得到得結果還是Fail(密碼錯誤)
空白密碼 & null 得到得結果還是Fail(密碼錯誤)
布林代數)

那...這個為何成功?
line vty 0 4
login local
transport input ssh
transport output none
之后,馬上就可以了。密碼已經確認過沒有問題

關鍵很明顯就在這里...login local
你明確的告訴Switch當有人用這條線路line vty 0 4登入時,使用本機的密碼作為認證方式
正確密碼 & 正確密碼 =True
布林代數)
但還有一個關鍵...你沒有下login這個命令
我前面有提到...
下了login,就是告訴switch在line vty 0 4啟用密碼驗證
所以正統的作法其實是...
line vty 0 4
login
login local
transport input ssh
transport output none

但是...後來Cisco考慮到人性的懶(講好聽叫...人性化)
在IOS上加入了這項功能
當使用者不敲login命令時,系統會自動幫login給加進去
雖然你只打了login local
但系統會自動幫你補上login(啟用密碼驗證)這條命令

因此你使用
line vty 0 4
(login)←系統會自動幫你補上
login local
transport input ssh
transport output none
是可行的

但是...使用
line vty 0 4
login
(它不會自動幫你補上login local)
transport input ssh
transport output none
是萬萬不可行的

這樣的解釋我猜你懂了^^

可惜...我不是高手(因為我沒有任何Cisco的證照)

注意:不是每個版本的IOS都會自動幫你補上login喔



查看完整回答
反對 回復 2019-03-07
  • 1 回答
  • 0 關注
  • 3334 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號