配置SSH远程登录

 

 R1配置

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 12.1.1.1 21
May 16 2020 22:43:48-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[0]:The line protocol
 IP on the interface GigabitEthernet0/0/0 has entered the UP state. 
[Huawei-GigabitEthernet0/0/0]q    
[Huawei]ssh client first-time enable 
[Huawei]

R2配置

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys AR2  

[AR2]interface GigabitEthernet 0/0/0
[AR2-GigabitEthernet0/0/0]ip addr 12.1.1.2 24

[AR2]stelnet server enable 
Info: Succeeded in starting the STELNET server.
[AR2]rsa local-key-pair create 
The key name will be: Host
% RSA keys defined for Host already exist.
Confirm to replace them? (y/n)[n]:y
The range of public key size is (512 ~ 2048).
NOTES: If the key modulus is greater than 512,
       It will take a few minutes.
Input the bits in the modulus[default = 512]:2048
Generating keys...
...........................................+++
................................................................+++
.........................++++++++
...........++++++++
[AR2]aaa
[AR2-aaa]local-user user-ssh password cipher huawei123 privilege level 15 idle-t
imeout 300
[AR2-aaa]local-user user-ssh service-type ssh
[AR2]user-interface vty 0 4
[AR2-ui-vty0-4]authentication-mode aaa
[AR2-ui-vty0-4]protocol inbound ssh 
[AR2]ssh user user-ssh authentication-type all
定义ssh用户的认证模式

测试

[Huawei]stelnet 12.1.1.2
Please input the username:user-ssh
Trying 12.1.1.2 ...
Press CTRL+K to abort
Connected to 12.1.1.2 ...
Enter password:
  ----------------------------------------------------------------------------- 
    
  User last login information:     
  -----------------------------------------------------------------------------
  Access Type: SSH      
  IP-Address : 12.1.1.1 ssh     
  Time       : 2020-05-16 22:57:15-08:00     
  -----------------------------------------------------------------------------
<AR2>

 

posted @ 2020-05-16 23:00  星火撩原  阅读(418)  评论(0编辑  收藏  举报