思科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
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
相关文章推荐
- 在思科路由器上配置SSH登录
- 思科SSH登录的配置
- Ubuntu 14.04 SSH 允许Root用户登录配置
- 配置Ubuntu安装vsftpd 只能访问默认目录 禁止用户登录SSH允许FTP Ubuntu 安装vsftpd 方法
- Ubuntu中ssh安装和修改ssh配置允许root登录
- 更改ssh服务远程登录的配置
- 多个客户机之间配置ssh免秘钥登录
- ssh免密码登录简略配置
- eclipse 配置git ssh登录
- Ubuntu 16.04下配置SSH免密码登录实践亲测
- ssh免密码登录的配置方法
- linux or Mac 配置 ssh免登录
- Win2012服务器 远程桌面帐户允许多用户同时登录的配置方法
- 配置ssh免密码登录——集群学习日记
- xshell配置ssh使用密钥公钥(publice key)登录
- CentOS下配置MySQL允许root用户远程登录
- linux配置免密码ssh登录
- Xshell配置SSH密钥登录Linux服务器
- Linux下ssh免密码登录配置(20160309)