您的位置:首页 > 其它

思科3750配置只允许SSH登录

2017-11-14 15:22 344 查看
交换机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版本2ip ssh time-out 120//配置SSH登入超时时间ip sshauthentication-retries 5 //登录重试次数login block-for 600 attempts 5 within 60 //60秒内错误登录5次,锁定600秒
5.配置只允许SSH配置0到4号线路只运行SSH
line vty 0 15 //进入line接口
login local //采用本地验证
exec-timeout 5 30 //配置会话超时,5分30秒后无操作则断开连接
transport input ssh //指定只能用ssh登陆exit6.关闭http访问no ip http server console口配置
config tline con 0password ciscociscologinexec-timeout 5 30endwr //保存配置注意:上面设置了只允许ssh登录那么telnet自然就关闭了。对于不支持SSH的交换机想要关闭telnet可以使用如下方法
conf tline vty 0 15
no password
transport input none
end
wr
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  cisco