文章摘要:
在某些环境中,可能需要安全管理访问。本文提供将管理访问限制为使用 HTTPS 和 SSH 的必要步骤。
注意:此过程需要使用命令行界面 (CLI)。可以通过串行或 telnet 会话使用此过程。但是,必须遵循这些步骤,以防止无意中阻止对远程管理的访问。
此过程假定:
- 交换机已配置了IP地址,并且可在网络中访问。
- 存在一个使用权限级别15创建的帐户。要验证这一点,请使用以下命令:
console# show users accounts
提醒:完成这些步骤后,您可能会收到有关正版证书的错误。这是由于证书和密钥是自生成的。这不是错误。
注意:在禁用Telnet或HTTP访问之前,请验证SSH或HTTPS访问。
提醒:如果已启用 SSH 或 HTTPS 并且需要禁用 Telnet 和 HTTP,请转至步骤 3 以禁用 Telnet,并转至步骤 5 以禁用 HTTP。
Process:
- 使用 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