删除vty 0 4 其他的vty 请教一下大佬,如何删除? # line vty 0 4 authentication-mode none user-role network-admin user-role network-operator idle-timeout 5 0 # line vty 5 52 user-role network-operator # line vty 53 user-role network-admin user-role network-operator # line vty 54 62 authentication-mode scheme user-role network-operator idle-timeout 5 0 # line vty 63 user-role network-operator
华三交换机(Comware 系统)的 VTY 线路是无法删除的,0~63 是固化的逻辑线路,一直存在。
我们能做的是 删除线路下的配置,让它恢复默认状态,也就是“清空这条线路的配置”。
你贴出的配置里,大部分都不是默认值,比如 authentication-mode none、user-role network-admin、idle-timeout 5 0 等,这些都可以用 undo 命令一条条删掉。
一、删除某一段 VTY 的配置(例如 0~4)
你想要删除 line vty 0 4 这一段的配置,让这些线路恢复默认,按下面操作:
bash
system-view
line vty 0 4
undo authentication-mode # 恢复默认认证方式
undo user-role # 去除额外角色(保留默认 network-operator)
undo idle-timeout # 去除闲置超时
quit
执行完后,0~4 线路就会变成:
认证方式:authentication-mode password(默认)
用户角色:network-operator(默认)
无 idle-timeout 限制(默认无超时)
如果你只是想解除 authentication-mode none(无密码登录),只执行 undo authentication-mode 也可以,但 必须保证设备上还有其他正确的认证配置(如设置了密码、AAA 等),否则你将无法再远程登录!
二、删除“其他 VTY”的配置
你贴出的“其他 VTY”包括:5~52、53、54~62、63。
操作思路完全一样,分别进入对应的 line vty 范围,把非默认配置 undo 掉。
1. 清空 5~52(目前只有 user-role network-operator,这其实已经是默认值,清不清都可以)
bash
line vty 5 52
undo user-role # 去掉该配置,恢复默认 network-operator
quit
2. 清空 53(有 network-admin 和 network-operator,需要去掉 network-admin)
bash
line vty 53
undo user-role # 先全部取消
user-role network-operator # 如果需要保留 operator(默认就有,不加也可以)
quit
或者只去掉 network-admin,保留 network-operator :
bash
line vty 53
undo user-role network-admin
quit
3. 清空 54~62(有 authentication-mode scheme、user-role network-operator、idle-timeout)
bash
line vty 54 62
undo authentication-mode
undo idle-timeout
undo user-role # 这个可忽略,默认就是 network-operator
quit
4. 清空 63(只有 user-role network-operator)
bash
line vty 63
undo user-role
quit
三、一次性查看并确认剩余配置
清完后,在系统视图下用:
bash
display current-configuration | include line vty
或者直接:
bash
display line vty
看看各个线路的配置是否已经恢复到你期望的状态。
四、两步安全提醒(非常重要)
如果你正在远程(SSH/Telnet)操作,删掉 authentication-mode none 或 scheme 前,务必先配置好新的认证(例如 set authentication password simple/hash ... 或 AAA 方案),否则一退出就无法再登录,只能 Console 口救。
不要同时清空所有 VTY 又不设密码,至少保留一条你正在使用的线路有合法认证,防止自己被锁在外面。
总结
无法删除 VTY 线路本身,只能清除上面的配置。
针对你想清理的 line vty 0 4 等段落,进入对应视图执行 undo xxx 即可。
重点注意保留可远程登录的认证方式,避免设备失联。
暂无评论
undo line vty 起始 结束
line vty 0 4
line vty 5 52
line vty 53
line vty 54 62
line vty 63
system-view
# 删除 5-52
undo line vty 5 52
# 删除 53
undo line vty 53 53
# 删除 54-62
undo line vty 54 62
# 删除 63
undo line vty 63 63
display current-configuration | include line vty
line vty 0 4
暂无评论
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
暂无评论