Remote side unexpectedly closed network connection,这是华三(H3C)交换机非常经典的一个配置问题。1system-view
2user-interface vty 0 4
3 authentication-mode scheme # 开启用户名密码认证
4 protocol inbound ssh # 明确允许 SSH 协议接入(关键!)
5 user-role network-admin # 赋予最高管理权限(关键!缺失会导致秒退)
6 quitadmin 用户本身没有开启 SSH 服务类型,或者没有绑定管理员角色,也会导致认证通过后被强制断开。1local-user admin class manage
2 service-type ssh # 必须包含 ssh,如果只配了 telnet 会被拒绝
3 authorization-attribute user-role network-admin # 确保用户拥有管理员角色
4 quit1# 全局开启 SSH 服务
2ssh server enable
3
4# 检查是否已生成 RSA 密钥对,如果没有则生成
5display public-key local rsa
6# 如果提示没有密钥,执行以下命令生成(长度建议 2048 以上)
7public-key local create rsa
display user-interface
idle-timeout 0永不超时;默认小于 1 分钟极易秒断system-view
user-interface vty 0 63
idle-timeout 15 #闲置15分钟断开,改成15
system-view
ssh server enable
# 开启通用加密、密钥交换算法
ssh server algorithm kex diffie-hellman-group-exchange-sha256 diffie-hellman-group1-sha1
ssh server algorithm encryption aes128-cbc aes192-cbc aes256-cbc aes128-ctr
ssh server algorithm hmac sha1 md5
display acl all | include vty
display user-interface vty 0 63
acl number 3000
rule permit ip source 客户端IP 0
user-interface vty 0 63
access-class 3000 inbound
display users,多余会话踢出free user-line XXX
user-interface vty 0 63 扩充线路范围display cpu-usage
terminal monitor
terminal debugging
debugging ssh all
undo debugging all
undo terminal debugging
暂无评论
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
暂无评论