设为首页收藏本站language 语言切换
查看: 1800|回复: 1
收起左侧

[原创] 关于华为SSH实验

[复制链接]
发表于 2019-12-16 22:43:17 | 显示全部楼层 |阅读模式
本帖最后由 shanpj 于 2019-12-16 23:24 编辑

  
        菜鸟笔记  

         关于设备远程管理,通用两种方式
          1  telnet  (明文传输不安全)
          2  SSH    (密文传输安全)  

       本次实验使用两台华为路由器,使用其中一台设备,通过SSH 访问另外一台设备
        实验目的,熟悉SSH 的配置方式。
              实验步骤   通过路由器R2   ssh 方式访问R1
        一,两台设备直连,通过配置接口IP, ping测试连通性,完成即可(省略)
        二   RI 配置的步骤为
       1       修改默认设备名            2       设置本地用户名和密码              
       3       设置域名  
       4       手动产生rsa的key 回车后需要键入key长度,推荐768以上。
       5        ip ssh verion 2      //  常用版本为2
       6        login local
       7        transport  input ssh
    进入AAA 模式下,设置用户名密码  、  设置 服务类型、设置该用户权限级别。
    命令如下
    local-user ccna password  cipher  hcna
    local-user ccna privilege level 3
    local-user ccna service-type ssh
   开启系统视图下开启ssh 服务
[AR1]stelnet server enable


   user-interface vty 0 4   //  进入vty通道 ,认证模式设置为AAA 并允许ssh 登陆。
   authentication-mode aaa
   protocol inbound ssh
系统视图下,创建RSA 的key
  rsa local-key-pair crea // 在设备上创建rsa的key,用于SSH使用。

[AR1]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]:512
Generating keys...
.++++++++++++
.............++++++++++++
...................++++++++

测试在设备上进行效果测试:如下
[AR2]stelnet 192.168.1.2
Please input the username:ccna
Trying 192.168.1.2 ...
Press CTRL+K to abort
Connected to 192.168.1.2 ...
Error: Failed to verify the server's public key.
Please run the command "ssh client first-time enable"to enable the first-time ac
cess function and try again.
[AR2]ssh client first-time enable
[AR2]stelnet 192.168.1.2
Please input the username:ccna
Trying 192.168.1.2 ...
Press CTRL+K to abort
Connected to 192.168.1.2 ...
The server is not authenticated. Continue to access it? (y/n)[n]:y
Dec 16 2019 23:16:37-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
Dec 16 2019 23:16:39-08:00 AR2 %%01SSH/4/SAVE_PUBLICKEY(l)[1]:When deciding whet
her to save the server's public key 192.168.1.2, the user chose Y.
[AR2]
The server's public key will be saved with the name 192.168.1.2. Please wait...

Enter password:
<AR1>
至此,在R2上通过SSH成功登陆R1   实验结束。









      

简单拓扑

简单拓扑
发表于 2019-12-17 12:16:03 | 显示全部楼层
好东西谢谢楼主分享
沙发 2019-12-17 12:16:03 回复 收起回复
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 论坛注册

本版积分规则

QQ|Archiver|手机版|小黑屋|sitemap|鸿鹄论坛 ( 京ICP备14027439号 )  

GMT+8, 2025-2-2 16:56 , Processed in 0.056981 second(s), 14 queries , Redis On.  

  Powered by Discuz!

  © 2001-2025 HH010.COM

快速回复 返回顶部 返回列表