欢迎访问 生活随笔!

生活随笔

当前位置: 首页 >

华为数通(一):如何使用ssh console telnet来连接设备

发布时间:2024/8/1 45 豆豆
生活随笔 收集整理的这篇文章主要介绍了 华为数通(一):如何使用ssh console telnet来连接设备 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

一.如何使用telnet进行连接

1. 需要在设备上创建一个可以登陆做的账户(在AR1上)

<R1>system-view //进入系统视图 [R1]aaa //进入aaa模式 [R1-aaa]local-user jah password cipher hauwei //创建账号密码 [R1-aaa]local-user jah privilege level 3 //设置账号等级 [R1-aaa]local-user jah service-type telnet //设置账号登录方式

2. 开启telenet服务

[R1]telnet server enable

3. 设置vty线路登陆模式

vty是虚拟线路,ssh和telent登录都需要通过它

[R1]user-interface vty 0 4 //进入vty线路 [R1-ui-vty0-4]authentication-mode aaa //设置vty登陆方式为账号密码登录

4. 通过PC进行登录

<PC1>telnet 10.1.1.1Press CTRL_] to quit telnet modeTrying 10.1.1.1 ...Connected to 10.1.1.1 ...Login authenticationUsername:jah Password: Error: Local authentication is rejected.Logged Fail!Username:

二.如何使用ssh进行登录?

  • 创建密钥
  • [R1] rsa local-key-pair create
  • 创建账号(允许ssh登录)
  • [R1] aaa [R1-aaa] local-user jah-ssh password cipher huawei [R1-aaa] local-user jah-sshprivilege level 3 [R1-aaa] local-user jah-ssh server-type ssh
  • 开启ssh登录服务
  • [R1] stelnet server enable
  • 然后不知道这一步干嘛但是要用
  • [R1] ssh user jah-ssh authentication-type password
  • 设置vty线路登陆模式,允许ssh登录
  • [R1] user-interface vty 0 4 [R1-ui-vty0-4] au aaa [R1-ui-vty0-4] protocol inbound ssh //这使得vty 0-4线路只能通过ssh登录不能通过telnet登录 如果是all就是都可以
  • ssh登录设备
  • <PC1>system-view Enter system view, return user view with Ctrl+Z. [PC1]ste [PC1]stelnet 10.1.1.1 Please input the username:jah-ssh Trying 10.1.1.1 ... Press CTRL+K to abort Connected to 10.1.1.1 ... 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. [PC1]ssh client first-time enable

    三.如何使用console进行登录?

    PC2是通过console和AR1设备进行连接的

  • 设置一个密码给console线路
  • <R1> sys [R1] user-interface console 0 //进入console线路 [R1-ui-console0]authentication-mode password Please configure the login password (maximum length 16):huawei
  • 通过console口登录
  • Configuration console exit, please press any key to log onLogin authenticationPassword:

    总结

    以上是生活随笔为你收集整理的华为数通(一):如何使用ssh console telnet来连接设备的全部内容,希望文章能够帮你解决所遇到的问题。

    如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。