R1配置密码认证
R2配置用户密码认证
R3配置SSH配置认证
R1 配置密码认证
<Huawei>system-view //进入系统视图模式
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R1 //更改系统名
[R1]
[R1]undo info-center enable //关闭提示信息
Info: Information center is disabled.
[R1]interface Ethernet 0/0/0 //进入0/0/0接口
[R1-Ethernet0/0/0]ip address 192.168.1.1 24 //配置IP地址
[R1-Ethernet0/0/0]undo shutdown //打开接口
Info: Interface Ethernet0/0/0 is not shutdown.
[R1-Ethernet0/0/0]quit //退出配置
[R1]display ip interface brief //查看IP配置情况
[R1]user-interface vty 0 4 //进入VTP 配置
[R1-ui-vty0-4]authentication-mode password //配置为密码认证
[R1-ui-vty0-4]set authentication password cipher 123456 //设置密码为123456 cipher为加密本地密码
[R1-ui-vty0-4]user privilege level 15 //配置权限为最高级别 0~15
[R1-ui-vty0-4]quit //退出配置
[R1]
用R3测试
R2 配置用户名密码认证
<Huawei>system-view //进入系统视图模式
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R1 //更改系统名
[R2]
[R2]undo info-center enable //关闭提示信息
Info: Information center is disabled.
[R2]interface Ethernet 0/0/0 //进入0/0/0接口
[R2-Ethernet0/0/0]ip address 192.168.1.2 24 //配置IP地址
[R2-Ethernet0/0/0]undo shutdown //打开接口
Info: Interface Ethernet0/0/0 is not shutdown.
[R2-Ethernet0/0/0]quit //退出配置
[R2]display ip interface brief //查看IP配置情况
[R2]aaa //进入aaa配置
[R2-aaa]local-user blab password cipher 123456 //配置本地密码及本地密文
Info: Add a new user.
[R2-aaa]local-user blab privilege level 3 //配置权限
[R2-aaa]local-user blab service-type telnet //调用telnet
[R2-aaa]quit //退出配置
[R2]user-interface vty 0 4 //进入VTY
[R2-ui-vty0-4]authentication-mode aaa //调用aaa
[R2-ui-vty0-4]quit //退出配置
[R2]
使用R3测试
R3 配置 SSH加密认证
<Huawei>system-view //进入系统视图模式
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R1 //更改系统名
[R3]
[R3]undo info-center enable //关闭提示信息
Info: Information center is disabled.
[R3]interface Ethernet 0/0/0 //进入0/0/0接口
[R3-Ethernet0/0/0]ip address 192.168.1.3 24 //配置IP地址
[R3-Ethernet0/0/0]undo shutdown //打开接口
Info: Interface Ethernet0/0/0 is not shutdown.
[R3-Ethernet0/0/0]quit //退出配置
[R3]display ip interface brief //查看IP配置情况
[R3]aaa //进入aaa配置
[R3-aaa]local-user blab password cipher 123456 //配置账号密码
Info: Add a new user.
[R3-aaa]local-user blab privilege level 3 //配置账号权限
[R3-aaa]local-user blab service-type ssh //调用SSH协议
[R3-aaa]quit //退出配置
[R3]ssh user blab authentication-type password //调用密码认证
Info: Succeeded in adding a new SSH user.
[R3]user-interface vty 0 4 //进入vty配置
[R3-ui-vty0-4]authentication-mode aaa //调用aaa配置
[R3-ui-vty0-4]protocol inbound ssh //调用ssh协议
[R3-ui-vty0-4]quit //退出配置
[R3]stelnet server enable //开启stelnetSSH
使用R1测试
[R1]ssh client first-time enable //首次使用需要开启ssh模式
[R1]stelnet 192.168.1.3 //ssh到目标
Please input the username:blab //输入账号
Trying 192.168.1.3 ...
Press CTRL+K to abort
Connected to 192.168.1.3 ...
The server is not authenticated. Continue to access it? [Y/N] :y
Save the server's public key? [Y/N] :y
The server's public key will be saved with the name 192.168.1.3. Please wait...
Enter password: //输入密码