思科3750配置只允許SSH登錄

交換機IOS版本過低的不支持SSH,如果執行crypto key generate rsa時提示沒有這個命令那肯定就是不支持SSH了。

進入全局配置模式

conf  t

1.啓用ssh 首先需要創建用戶
username cisco password ciscocisco

注意:如果通過查看交換機配置(show run)已經產生過密鑰了2和3步驟可以跳過
2.配置一個域名
ip domain-name cisco.cn
3.生成密鑰組
crypto key generate rsa
 密鑰長度設置爲:2048位

4.指定ssh版本
ip ssh version 2 //配置SSH版本2

ip ssh time-out 120//配置SSH登入超時時間

ip sshauthentication-retries 5 //登錄重試次數

login block-for 600 attempts 5 within 60 //60秒內錯誤登錄5次,鎖定600秒
5.配置只允許SSH

配置0到15號線路只運行SSH
line vty 0 15 //進入line接口
login local //採用本地驗證
exec-timeout 5 30 //配置會話超時,5分30秒後無操作則斷開連接
transport input ssh  //指定只能用ssh登陸

exit

6.關閉http訪問

no ip http server

 

console口配置

config t

line con 0

password ciscocisco

login

exec-timeout 5 30

end

wr  //保存配置

注意:上面設置了只允許ssh登錄那麼telnet自然就關閉了。對於不支持SSH的交換機想要關閉telnet可以使用如下方法

conf t

line vty 0 15

no password

transport input none 

end

wr

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章