|
为了防止一拿个笔记本接入控制口就能配置交换机,可以考虑设置一个密码。
1. 进入 console0
<Huawei>system-view
[Huawei]user-interface con 0
2. 使用 authentication-mode 命令添加密码:
[Huawei-ui-console0]authentication-mode ?
aaa AAA authentication
none Login without checking
password Authentication through the password of a user terminal interface
none 是默认行为,不需要密码即可登录。
password 要求在进入 console 时需要输入一个密码。运行以下命令:
authentication-mode password
这一步命令,仅是告诉交换机登录时需要输入密码,但下一步还需要进一步设定一个密码。
3. 设定密码:
[Huawei-ui-console0]set authentication password ?
cipher Set the password with cipher text
simple Set the password in plain text
simple 是以明文保存密码;cipher 是以密文保存密码。
比如要以明文保存密码,那么只要:
- [Huawei-ui-console0]set authentication password simple 1234567
复制代码
明文保存的密码在执行 display current-configuration 命令时,可以看得到。
在 authentication-mode 中,还有一项 aaa ,表示需要同时需要输入用户名和密码才能登录。在执行了 authentication-mode aaa 命令后,要先 quit 退出,然后在系统视图模式下,建立用户:[Huawei]aaa
[Huawei-aaa]local-user groad password cipher 123456
Info: Add a new user.
上面增加了一个名为 groad 的用户,密码为 123456,以加密方式存放。这样做之后,一直 quit 退出,那么再登录时,就会看到需要输入用户名和密码的提示:
Please Press ENTER.
Login authentication
Username:
注意,如果是 EPSN 虚拟机才做,光是如上配置,那么在关闭交换机并重启或下次打开软件时,之前所做的配置会消失。保存方法有二:
1. 在用户视图模式下,直接敲入 save 命令保存,然后再在 ensp 上单击工具栏上的 “保存” 按钮,将拓扑保存下来。
2. 在设备图标上右键菜单中,导出配置。
|
|