华为路由器/交换机上配置Stelnet远程登录

Stelnet是加密的远程登录协议,它是基于SSH协议实现的。Stelnet 是 SSH 协议在网络设备远程管理中的具体应用,允许管理员通过加密的SSH通道安全地访问网络设备的命令行界面(CLI),进行配置、监控和管理。

以下是Stelnet的配置实例。

拓扑图如下所示。

华为路由器/交换机上配置Stelnet远程登录_第1张图片

先配置好IP地址作为远程登录的地址。

AR1路由器:
[AR1]int g0/0/0
[AR1-GigabitEthernet0/0/0]
[AR1-GigabitEthernet0/0/0]ip add 10.0.0.1 30


AR2路由器:
[AR2]int g0/0/0
[AR2-GigabitEthernet0/0/0]
[AR2-GigabitEthernet0/0/0]ip add 10.0.0.2 30

在AR1上开启stelnet功能,创建一个本地账户,账号为user1,密码为Huawei@123。配置账户的服务类型为SSH,进入虚拟终端接口视图配置认证模式为aaa, 允许外部网络通过SSH协议(Secure Shell)访问内部网络。

[AR1]stelnet server enable 
Info: Succeeded in starting the STELNET server.
[AR1]aaa
[AR1-aaa]local-user user1 password cipher Huawei@123
Info: Add a new user.
[AR1-aaa]local-user user1 service-type SSH
[AR1-aaa]user-interface vty 0 4
[AR1-ui-vty0-4]authentication-mode aaa
[AR1-ui-vty0-4]protocol inbound ssh

在AR2客户端上使能SSH客户端首次认证。当SSH客户端首次访问SSH服务器,而SSH客户端没有配置SSH服务器端的公钥时,用户可以选择使能SSH客户端首次认证继续访问该SSH服务器,并在SSH客户端保存该主机公钥;当SSH客户端下次访问该SSH服务器时,就以保存的主机公钥来认证该SSH服务器。AR2就可以stelnet远程登录AR1了。

在AR2上输入用户名后确认会弹出提示服务器端未通过身份认证,确定访问它吗?输入“y”确认,后会弹出需要保存服务器的公钥吗?输入“y”确认,接着输入密码就能登录进AR1了。

[AR2]ssh client first-time enable
[AR2]stelnet 10.0.0.1
Please input the username:user1
Trying 10.0.0.1 ...
Press CTRL+K to abort
Connected to 10.0.0.1 ...
The server is not authenticated. Continue to access it? (y/n)[n]:y
Nov 14 2024 08:52:28-08:00 AR2 %%01SSH/4/CONTINUE_KEYEXCHANGE(l)[0]:The server h
ad not been authenticated in the process of exchanging keys. When deciding wheth
er to continue, the user chose Y. 
[AR2]
Save the server's public key? (y/n)[n]:y
The server's public key will be saved with the name 10.0.0.1. Please wait...

Nov 14 2024 08:52:36-08:00 AR2 %%01SSH/4/SAVE_PUBLICKEY(l)[1]:When deciding whet
her to save the server's public key 10.0.0.1, the user chose Y. 
[AR2]
Enter password:

你可能感兴趣的:(华为,网络,信息与通信,网络协议)