文章摘要:
在某些環境中,可能需要安全管理訪問許可權。本文提供使用 HTTPS 和 SSH 限制管理存取的必要步驟。
警示:此程序需要使用命令行介面 (CLI)。可透過序列或 telnet 工作階段使用此程序。但是,必須執行這些步驟,以防止無意中阻止對遠端管理的訪問。
此程序假設:
- 交換器已設定 IP 位址,且可在網路內連線。
- 有一個使用權限層級 15 建立的帳戶。若要確認,請使用以下命令:
console# show users accounts
注意:完成這些步驟後,您可能會收到與憑證真實性相關的錯誤。這是因為憑證和金鑰為自我產生。這不是錯誤。
警示:停用 telnet 或 HTTP 存取之前,請先確認 SSH 或 HTTPS 存取。
注意:如果已啟用 SSH 或 HTTPS,且需要停用 telnet 和 HTTP,請前往步驟 3 以停用 telnet,以及步驟 5 以停用 HTTP。
程序:
- 使用命令行介面 (CLI) 連線至交換器
- 若要啟用 SSH,請輸入下列命令:
console>enable
console#config
console(config)#crypto key generate rsa
console(config)#crypto key generate dsa
console(config)# ip ssh server
- 若要停用 telnet,請輸入:
console(config)# ip telnet server disable
- 若要啟用 HTTPS,請輸入下列命令:
console(config)# crypto certificate 1 generate
console(config-crypto-cert)#key-generate <512-2048>
console(config-crypto-cert)#exit
console(config)#ip https certificate 1
console(config)# ip https server
注意:該系統能夠生成和存儲兩個證書。若要產生第二個金鑰,請將數字 1 替換為 2。若要啟動第二個金鑰,請使用 console(config)#ip https certificate 2
。
- 若要停用 HTTP,請輸入:
console(config)# no ip http server
- 使用 SSH 或 HTTPS 確認連線能力後,請輸入以下命令以儲存組態:
console# copy running-config startup-config