Telnet的三种登录方式

                                              作者:尹正杰

版权声明:原创作品,谢绝转载!否则将追究法律责任。

一.华为创建telnet的三种验证方式

  首先,我们可以简单的看一个拓扑图,让我们可以在亦庄的路由器上对双桥的路由器进行操作。

1.无验证登录(none方式)

给需要远程的路由器配置一个互联的IP地址即可:

 “亦庄机房”配置如下:
[Huawei]interface Ethernet 0/0/1
[Huawei-Ethernet0/0/1]ip address 172.30.1.1 24
[Huawei-Ethernet0/0/1]undo shutdown
[Huawei-Ethernet0/0/1]quit
6 [huawei]sysname yizhuang

在需要远程的路由器上需要开启Telnet服务:

“双桥机房”配置如下:
[Huawei]interface Ethernet 0/0/1
[Huawei-Ethernet0/0/1]ip address 172.30.1.2 24
[Huawei-Ethernet0/0/1]undo shutdown
[Huawei-Ethernet0/0/1]quit
[Huawei]telnet server enable #开启telnet功能
[Huawei]user-interface vty 0 4
[Huawei-ui-vty0-4]authentication-mode none #设置认证模式
[Huawei-ui-vty0-4]user privilege level 3 #指定登录账号的级别
10[huawei]sysname shuangqiao

测试:

 [yizhuang]interface Ethernet 0/0/1
[yizhuang-Ethernet0/0/1]display this #查看当前接口信息
#
interface Ethernet0/0/1
ip address 172.30.1.1 255.255.255.0
#
return
[yizhuang-Ethernet0/0/1]ping 172.30.1.2 #检查是否能和互联地址ping通
PING 172.30.1.2: 56 data bytes, press CTRL_C to break
Reply from 172.30.1.2: bytes=56 Sequence=1 ttl=255 time=40 ms
Reply from 172.30.1.2: bytes=56 Sequence=2 ttl=255 time=30 ms
Reply from 172.30.1.2: bytes=56 Sequence=3 ttl=255 time=50 ms
Reply from 172.30.1.2: bytes=56 Sequence=4 ttl=255 time=50 ms
Reply from 172.30.1.2: bytes=56 Sequence=5 ttl=255 time=20 ms --- 172.30.1.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/38/50 ms [yizhuang-Ethernet0/0/1]quit
[yizhuang]quit
<yizhuang>telnet 172.30.1.2 #远程双桥地址
Trying 172.30.1.2 ...
Press CTRL+K to abort
Connected to 172.30.1.2 ... Info: The max number of VTY users is 10, and the number
of current VTY users on line is 1.
The current login time is 2017-04-18 18:15:39.
<shuangqiao> #登录成功,显示的双桥的主机名
<shuangqiao>
<shuangqiao>

  很显然:上面不用输入任何信息就能登录,没有安全性可言,谁都能远程你的设备,所以,这种配置我们一般不采取,除非我们在做实验的时候会用,好吧~anyway,忘记它吧。

2.基于用户名验证(password登录方式)

清华园路由器配置:

 “清华园机房”配置如下:
<Huawei>system-view
[Huawei]interface Ethernet 0/0/1
[Huawei-Ethernet0/0/1]ip address 172.30.1.1 24
[Huawei-Ethernet0/0/1]undo shutdown
[Huawei]sysname qinghuayuan

廊坊路由器配置:

 “廊坊机房”配置如下:
<Huawei>system-view
[Huawei]sysname langfang
[langfang]interface Ethernet 0/0/1
[langfang-Ethernet0/0/1] ip address 172.30.1.2 24
[langfang-Ethernet0/0/1]undo shutdown
[langfang-Ethernet0/0/1]quit
[langfang]telnet server enable
[langfang]user-interface vty 0 4
[langfang-ui-vty0-4]authentication-mode password #认真的模式
[langfang-ui-vty0-4]set authentication password simple yinzhengjie #设置明文密码是“yinzhengjie”

测试结果如下:

 [qinghuayuan-Ethernet0/0/1]display this
#
interface Ethernet0/0/1
ip address 172.30.1.1 255.255.255.0
#
return
[qinghuayuan-Ethernet0/0/1]ping 172.30.1.2
PING 172.30.1.2: 56 data bytes, press CTRL_C to break
Reply from 172.30.1.2: bytes=56 Sequence=1 ttl=255 time=50 ms
Reply from 172.30.1.2: bytes=56 Sequence=2 ttl=255 time=50 ms
Reply from 172.30.1.2: bytes=56 Sequence=3 ttl=255 time=50 ms
Reply from 172.30.1.2: bytes=56 Sequence=4 ttl=255 time=60 ms
Reply from 172.30.1.2: bytes=56 Sequence=5 ttl=255 time=30 ms --- 172.30.1.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 30/48/60 ms [qinghuayuan-Ethernet0/0/1]
<qinghuayuan>telnet 172.30.1.2
Trying 172.30.1.2 ...
Press CTRL+K to abort
Connected to 172.30.1.2 ... Login authentication Password: #在此处输入密码
Info: The max number of VTY users is 10, and the number
of current VTY users on line is 1.
The current login time is 2017-04-18 18:28:18.
<langfang> #密码输出正确登录成功
<langfang>

3.基于用户名和密码验证

兆维机房配置如下:

 “兆维机房”配置如下:
<Huawei>system-view
[Huawei]sysname zhaowei
[zhaowei]interface Ethernet 0/0/1
[zhaowei-Ethernet0/0/1]ip address 172.30.1.1 24
[zhaowei-Ethernet0/0/1]undo shutdown
[zhaowei-Ethernet0/0/1]display this
#
interface Ethernet0/0/1
ip address 172.30.1.1 255.255.255.0
#
return
[zhaowei-Ethernet0/0/1]
[zhaowei-Ethernet0/0/1]quit

鲁谷机房配置如下:

 “鲁谷机房”配置如下:
<Huawei>system-view
[Huawei]sysname lugu
[lugu]interface Ethernet 0/0/1
[lugu-Ethernet0/0/1]ip address 172.30.1.2 24
[lugu-Ethernet0/0/1]display this
#
interface Ethernet0/0/1
ip address 172.30.1.2 255.255.255.0
#
return
[lugu-Ethernet0/0/1]
[lugu-Ethernet0/0/1]undo shutdown
[lugu-Ethernet0/0/1]quit
[lugu]user-interface vty 0 4
[lugu-ui-vty0-4]authentication-mode aaa
[lugu-ui-vty0-4]user privilege level 3
[lugu-ui-vty0-4]quit
[lugu]aaa #进入aaa配置模式,这是华为的一个特色,哈哈
[lugu-aaa]local-user yinzhengjie password cipher 123 #创建一 个用户是尹正杰,密码是用密文加密的是""
[lugu-aaa]local-user yinzhengjie service-type telnet #只给 yinzhengjie 这个用户telnet的权限
[lugu-aaa]quit
[lugu]super password simple yinzhengjie #设置用户模式进入系统 配置模式的密码为yinzhengjie,加密格式是明文的哟,可以用dis cu 来查看到这个密码,建议设置成密文。根据你的重要性了 

测试:

 测试:

 [zhaowei-Ethernet0/0/1]display this
#
interface Ethernet0/0/1
ip address 172.30.1.1 255.255.255.0
#
return
[zhaowei-Ethernet0/0/1]ping 172.30.1.2
PING 172.30.1.2: 56 data bytes, press CTRL_C to break
Reply from 172.30.1.2: bytes=56 Sequence=1 ttl=255 time=60 ms
Reply from 172.30.1.2: bytes=56 Sequence=2 ttl=255 time=40 ms
Reply from 172.30.1.2: bytes=56 Sequence=3 ttl=255 time=30 ms
Reply from 172.30.1.2: bytes=56 Sequence=4 ttl=255 time=50 ms
Reply from 172.30.1.2: bytes=56 Sequence=5 ttl=255 time=40 ms --- 172.30.1.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 30/44/60 ms [zhaowei-Ethernet0/0/1]
<zhaowei>telnet 172.30.1.2
Trying 172.30.1.2 ...
Press CTRL+K to abort
Connected to 172.30.1.2 ... Login authentication Username:yinzhengjie
Password:
Info: The max number of VTY users is 10, and the number
of current VTY users on line is 1.
The current login time is 2017-04-18 18:56:35.
<lugu>

二.华为配置远程的主要命令说明

 [yinzhengjie]aaa
[yinzhengjie-aaa]local-user yinzhengjie password cipher 123
[yinzhengjie-aaa]local-user yinzhengjie privilege level
[yinzhengjie-aaa]local-user yinzhengjie service-type telnet
[yinzhengjie-aaa]quit
[yinzhengjie]user-interface vty
[yinzhengjie-ui-vty0-]authentication-mode aaa
[yinzhengjie-ui-vty0-]user privilege level
[yinzhengjie-ui-vty0-]protocol inbound telnet
[yinzhengjie-ui-vty0-]quit
[yinzhengjie]telnet server enable

三.H3C配置远程管理的案例展示

网络拓扑图实验:
 

1.不需要验证(none,该方式不推荐使用,一般都是你在实验的时候可以这样配置,现实中切记不要使用哟!)
 >.R1路由器配置如下
[R1]interface GigabitEthernet /
[R1-GigabitEthernet0/]ip address 172.30.1.1
[R1-GigabitEthernet0/]undo shutdown
[R1-GigabitEthernet0/]quit
[R1]telnet server enable ------开启Telnet服务
[R1]user-interface vty
[R1-line-vty0-]authentication-mode none
[R1-line-vty0-]user-role level- ------->指定登录账号的级别
[R1-line-vty0-] >.R2路由器配置如下
[R2]interface GigabitEthernet /
[R2-GigabitEthernet0/]ip address 172.30.1.2
[R2-GigabitEthernet0/]undo shutdown
[R2-GigabitEthernet0/]ping 172.30.1.1
Ping 172.30.1.1 (172.30.1.1): data bytes, press CTRL_C to break
bytes from 172.30.1.1: icmp_seq= ttl= time=1.067 ms
bytes from 172.30.1.1: icmp_seq= ttl= time=0.590 ms
bytes from 172.30.1.1: icmp_seq= ttl= time=0.640 ms
bytes from 172.30.1.1: icmp_seq= ttl= time=0.605 ms
bytes from 172.30.1.1: icmp_seq= ttl= time=0.578 ms --- Ping statistics for 172.30.1.1 ---
packets transmitted, packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.578/0.696/1.067/0.187 ms
[R2-GigabitEthernet0/]%Feb ::: R2 PING//PING_STATISTICS: Ping statistics for 172.30.1.1: packets transmitted, packets received, 0.0% packet loss, round-trip min/avg/max/std-dev = 0.578/0.696/1.067/0.187 ms. [R2-GigabitEthernet0/]quit
[R2]quit
<R2>telnet 172.30.1.1 ------->这里我们就开始Telnet设备R1,只要2个设备连通就可以远程上去了
Trying 172.30.1.1 ...
Press CTRL+K to abort
Connected to 172.30.1.1 ... ******************************************************************************
* Copyright (c) - Hangzhou H3C Tech. Co., Ltd. All rights reserved. *
* Without the owner's prior written consent, *
* no decompiling or reverse-engineering shall be allowed. *
****************************************************************************** <R1>
2.只需要密码验证(password)
 .R1路由器配置如下:
[R1]interface GigabitEthernet /
[R1-GigabitEthernet0/]ip address 172.30.1.1
[R1-GigabitEthernet0/]undo shutdown
[R1-GigabitEthernet0/]quit
[R1]telnet server enable
[R1]user-interface vty
[R1-line-vty0-]authentication-mode password ----->开启认证模式为password模式
[R1-line-vty0-]set authentication password simple ------>设置认证密码为123(明文哟)
[R1-line-vty0-]user-role level- ------->设置账户的等级为15级
[R1-line-vty0-] >.R2路由器配置如下
[R2]interface GigabitEthernet /
[R2-GigabitEthernet0/]IP address 172.30.1.2
[R2-GigabitEthernet0/]undo shutdown
[R2-GigabitEthernet0/]quit
[R2]quit
<R2>telnet 172.30.1.1 ------->开始远程R1路由器
Trying 172.30.1.1 ...
Press CTRL+K to abort
Connected to 172.30.1.1 ... ******************************************************************************
* Copyright (c) - Hangzhou H3C Tech. Co., Ltd. All rights reserved. *
* Without the owner's prior written consent, *
* no decompiling or reverse-engineering shall be allowed. *
****************************************************************************** Password: ------->我们需要设置R1设置的密码, 即“”
<R1>
<R1>
<R1>
3.需要用户名和密码验证(scheme方式)
 >.R1路由器配置如下:
[R1]interface GigabitEthernet /
[R1-GigabitEthernet0/]IP address 172.30.1.1
[R1-GigabitEthernet0/]undo shutdown
[R1-GigabitEthernet0/]quit
[R1]telnet server enable
[R1]user-interface vty
[R1-line-vty0-]authentication-mode scheme ------>开启用户名密码登录方式
[R1-line-vty0-]user-role level-
[R1-line-vty0-]quit
[R1]local-user yinzhengjie
New local user added.
[R1-luser-manage-yinzhengjie]password simple ------>设置明文密码为""
[R1-luser-manage-yinzhengjie]service-type telnet ----->设置服务类型及优先级
[R1-luser-manage-yinzhengjie]quit
[R1]super password simple ------>这里我们设置了普通视图进入系统视图的密码,个别用户是需要输入这个密码才可以登录进来的哟! >.R2路由器配置如下:
[R2]interface GigabitEthernet /
[R2-GigabitEthernet0/]ip address 172.30.1.2
[R2-GigabitEthernet0/]undo shutdown
[R2-GigabitEthernet0/]quit
[R2]quit
<R2>telnet 172.30.1.1
Trying 172.30.1.1 ...
Press CTRL+K to abort
Connected to 172.30.1.1 ... ******************************************************************************
* Copyright (c) - Hangzhou H3C Tech. Co., Ltd. All rights reserved. *
* Without the owner's prior written consent, *
* no decompiling or reverse-engineering shall be allowed. *
****************************************************************************** login: yinzhengjie ----->这里我们输入在R1上配置的用户名“yinzhengjie”
Password: ------>这里我们输入用户名“yinzhengjie”对应的密码“”
<R1>
<R1>

Telnet的三种登录方式的更多相关文章

  1. 基于ftp服务的三种登录方式及其相关的访问控制和优化

    ftp(简单文件传输协议),是一种应用广泛的网络文件传输协议和服务,占用20和21号端口,主要用于资源的上传和下载. 在linux对于ftp同widows一样具有很多的种类,这里主要介绍vsfptd( ...

  2. Spring Security构建Rest服务-1202-Spring Security OAuth开发APP认证框架之重构3种登录方式

    SpringSecurityOAuth核心源码解析 蓝色表示接口,绿色表示类 1,TokenEndpoint 整个入口点,相当于一个controller,不同的授权模式获取token的地址都是 /oa ...

  3. linux学习之centos(二):虚拟网络三种连接方式和SecureCRT的使用

    ---操作环境--- 虚拟机版本:VMware Workstation_10.0.3 Linux系统版本:CentOS_6.5(64位) 物理机系统版本:win10  一.虚拟网络三种连接方式 当在V ...

  4. MVC-AOP思想-Filter 三种注册方式

    在ASP.NET MVC框架中,为我们提供了四种类型的Filter类型包括:IAuthorizationFilter.IActionFilter.IResultFilter.IExceptionFil ...

  5. python-web自动化-三种等待方式

    当有元素定位不到时,比如下拉框,弹出框等各种定位不到时:一般是两种问题:1 .有frame :2.没有加等待 下面学习三种等待方式: 1.强制等待 sleep(xx)这种方法简单粗暴,不管浏览器是否加 ...

  6. Linux基石【第二篇】虚拟网络三种连接方式(转载)

    在虚拟机上安装完Centos系统后,开始配置静态IP,以方便在本宿主机上可以访问虚拟机,在曲折的配置中,了解到虚拟机还有三种连接方式:Bridged,NAT和Host-only,于是,我又一轮新的各种 ...

  7. MVC-AOP(面向切面编程)思想-Filter 三种注册方式

    在ASP.NET MVC框架中,为我们提供了四种类型的Filter类型包括:IAuthorizationFilter.IActionFilter.IResultFilter.IExceptionFil ...

  8. python笔记-20 django进阶 (model与form、modelform对比,三种ajax方式的对比,随机验证码,kindeditor)

    一.model深入 1.model的功能 1.1 创建数据库表 1.2 操作数据库表 1.3 数据库的增删改查操作 2.创建数据库表的单表操作 2.1 定义表对象 class xxx(models.M ...

  9. Django-多对多关系的三种创建方式-forms组件使用-cookie与session-08

    目录 表模型类多对多关系的三种创建方式 django forms 组件 登录功能手写推理过程 整段代码可以放过来 forms 组件使用 forms 后端定义规则并校验结果 forms 前端渲染标签组件 ...

随机推荐

  1. Filter(转载)

    web.xml中元素执行的顺序listener->filter->struts拦截器->servlet. 1.过滤器的概念 Java中的Filter 并不是一个标准的Servlet ...

  2. ACL访问控制

    /etc/squid/squid.conf 定义语法: acl aclname  acltype   string acl  aclname  acltype   "file" s ...

  3. 运用PDO存储将图片、音频文件存入数据库

    在数据库中创建表格的时候,有一个字段为image,用来保存图片,那么其类型就是blob,关于blob,百度百科是这样描述的 BLOB (binary large object),二进制大对象,是一个可 ...

  4. activiti-explorer disable demo

    https://community.alfresco.com/thread/203012-activiti-explorer engine.properties # demo data propert ...

  5. Setting Tomcat Heap Size (JVM Heap) in Eclipse

    this article picked from:http://viralpatel.net/blogs/setting-tomcat-heap-size-jvm-heap-eclipse/ Rece ...

  6. yarn工具的使用

    <!-- yarn init === npm init --> <!-- yarn login === npm adduser -->登录 <!-- yarn publi ...

  7. [自学]Docker system 命令 查看docker镜像磁盘占用情况 Docker volume 相关

    内容From https://docs.docker.com/engine/reference/commandline/system_df/ docker的image和docker的container ...

  8. WebService相关

    1.WebService 之 WSDL文件 讲解 2.WSDL样式详解 3.IntelliJ IDEA 开发 WebService 4.浅谈WebService的调用 5.用IDEA8快速开发WebS ...

  9. c++ 为自定义类添加stl遍历器风格的遍历方式

    为仿照stl的遍历风格,实现对自定义类型的遍历. 1. 需要遍历的基础结构: struct ConnectionPtr { int id_; int port_; string addr_; //st ...

  10. 利用可变参数打印log2

    #pragma once #include <string> #include "StdAfx.h" #include <Windows.h> using ...