分享

配置通过STelnet登录设备示例

 曾淼Mark 2019-07-04

组网需求

图4-13所示,用户希望安全的远程登录设备,但是Telnet缺少安全的认证方式,用户可以通过STelnet方式进行远程的安全登录。终端PC和SSH服务器之间路由可达,10.137.217.203是SSH服务器的管理口IP地址。在SSH服务器端配置用户client001,PC使用client001用户通过Password认证方式登录SSH服务器。

图4-13  配置用户通过STelnet登录设备组网图

使用STelnet V1协议存在安全风险,建议使用STelnet V2登录设备。

配置思路

采用如下的思路配置用户通过STelnet登录设备:

  1. PC端已安装登录SSH服务器软件。

  2. 在SSH服务器端生成本地密钥对,实现在服务器端和客户端进行安全地数据交互。

  3. 在SSH服务器端配置SSH用户client001。

  4. 在SSH服务器端开启STelnet服务功能。

  5. 在SSH服务器端配置SSH用户client001服务方式为STelnet。

  6. 用户client001以STelnet方式登录SSH服务器。

操作步骤

  1. 在服务器端生成本地密钥对
    <HUAWEI> system-view
    [HUAWEI] sysname SSH_Server
    [SSH_Server] dsa local-key-pair create
    Info: The key name will be: HUAWEI_Host_DSA.                                                                                
    Info: The key modulus can be any one of the following : 1024, 2048.                                                            
    Info: If the key modulus is greater than 512, it may take a few minutes.        
    Please input the modulus [default=2048]:                                        
    Info: Generating keys...                                                        
    Info: Succeeded in creating the DSA host keys.
  2. 在服务器端创建SSH用户

    # 配置VTY用户界面。

    [SSH_Server] user-interface vty 0 4
    [SSH_Server-ui-vty0-4] authentication-mode aaa
    [SSH_Server-ui-vty0-4] protocol inbound ssh
    [SSH_Server-ui-vty0-4] quit

    # 新建用户名为client001的SSH用户,且认证方式为Password。

    [SSH_Server] aaa
    [SSH_Server-aaa] local-user client001 password irreversible-cipher Huawei@123
    [SSH_Server-aaa] local-user client001 privilege level 3
    [SSH_Server-aaa] local-user client001 service-type ssh
    [SSH_Server-aaa] quit
    [SSH_Server] ssh user client001 authentication-type password
  3. SSH服务器端开启STelnet服务功能
    [SSH_Server] stelnet server enable
  4. 配置SSH用户client001的服务方式为STelnet
    [SSH_Server] ssh user client001 service-type stelnet
    
  5. 验证配置结果

    # PC端client001用password认证方式连接SSH服务器。

    # 通过PuTTY软件登录设备,输入设备的IP地址,选择协议类型为SSH。
    图4-14  通过PuTTY软件用password认证方式连接SSH服务器示意图

    # 点击“Open”,出现如下界面,输入用户名和密码,并按Enter键,至此已登录到SSH服务器。(以下显示信息仅为示意)

    login as: client001
    Sent username "client001"
    
    client001@10.137.217.203's password:
    
    Info: The max number of VTY users is 8, and the number
          of current VTY users on line is 5.
          The current login time is 2012-08-06 09:35:28+00:00.
    <SSH_Server>

配置文件

SSH_Server的配置文件

#
sysname SSH_Server
#
aaa
 local-user client001 password irreversible-cipher $1a$aVW8S=aP=B<OWi1Bu'^R[=_!~oR*85r_nNY+kA(I}[TiLiVGR-i/'DFGAI-O$
 local-user client001 privilege level 3
 local-user client001 service-type ssh
#
stelnet server enable
ssh user client001
ssh user client001 authentication-type password
ssh user client001 service-type stelnet
#
user-interface vty 0 4
 authentication-mode aaa
#
return

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多