配置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 @   星火撩原  阅读(425)  评论(0编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
点击右上角即可分享
微信分享提示