路由器开启SSH服务
sysname RG
user-interface vty 0 4
authentication-mode aaa
protocol inbound ssh
quit
aaa
local-user abc password cipher admin@123
local-user abc privilege level 15
local-user abc service-type ssh
quit
stelnet server enablessh user abc authentication-type password
ssh user abc service-type stelnet
interface g0/0/0
ip address 192.168.58.1 24
quit
把另一台路由器配置为SSH客户端
[Huawei]sysname pc
[pc]interface g0/0/0
[pc-GigabitEthernet0/0/0]ip address 192.168.58.100 24
[pc-GigabitEthernet0/0/0]quit[pc]ssh client first-time enable # 使能SSH客户端首次认证功能
在客户端通过SSH路由器
[pc]stelnet 192.168.58.1
Please input the username:abc
Trying 192.168.58.1 ...
Press CTRL+K to abort
Connected to 192.168.58.1 ...
The server is not authenticated. Continue to access it? (y/n)[n]:yMar 21 2024 17:07:19-08:00 Huawei %%01SSH/4/CONTINUE_KEYEXCHANGE(l)[2]:The server had not been authenticated in the process of exchanging keys. When deciding wh
ether to continue, the user chose Y.
[pc]Save the server's public key? (y/n)[n]:y
Mar 21 2024 17:10:39-08:00 Huawei %%01SSH/4/SAVE_PUBLICKEY(l)[5]:When deciding whether to save the server's public key 192.168.58.1, the user chose Y.
The server's public key will be saved with the name 192.168.58.1. Please wait...[pc]
Enter password:admin@123<RG>