04 |
您所在的位置:网站首页 › h3c路由器登录界面手机 › 04 |
1 特性简介
本文档介绍了使用SSH(Secure Shell,安全外壳)功能实现安全的远程访问或文件管理的典型配置举例。 2 配置前提本文档适用于使用Comware V7软件版本的MSR系列路由器,如果使用过程中与产品实际情况有差异,请参考相关产品手册,或以设备实际情况为准。 本文档中的配置均是在实验室环境下进行的配置和验证,配置前设备的所有参数均采用出厂时的缺省配置。如果您已经对设备进行了配置,为了保证配置效果,请确认现有配置和以下举例中的配置不冲突。 本文假设您已了解SSH特性。 3 设备作为Stelnet服务器配置举例(password认证) 3.1 组网需求如图3-1所示,网络管理员需要通过Internet远程登录到校园网的网关设备(Device)上对其进行相关配置。为了提高对Device进行管理的安全性,可将Device配置为Stelnet服务器,并在Host上运行Stelnet客户端软件,在二者之间建立SSH连接。要求: · Device通过SSH的password认证方式对客户端进行认证,认证过程在Device本地完成; · 网络管理员Host的登录用户名为client001,密码为123456TESTplat&!,登录设备后可以正常使用所有命令。 图3-1 设备作为Stelnet服务器配置组网图 3.2 配置思路 · 为了使SSH的版本协商和算法协商过程正常运行,且为了保证客户端对连接的服务器的认证正常进行,请在服务器端生成RSA、DSA密钥对。 · 为了采用本地认证的方式认证用户,需要在本地服务器Device上创建相应的本地用户,并在本地用户视图下配置密码。 · Stelnet客户端通过VTY用户线访问设备。因此,需要配置登录用户线的认证方式为scheme方式。 · 为了使Stelnet用户登录设备后能正常使用所有命令,将用户角色设置为network-admin,缺省情况下本地用户的用户角色为network-operator。 3.3 使用版本本举例适用于H3C Comware V7平台的MSR系列路由器。以H3C MSR3610-X1产品的R6749P14版本为示例,具体操作可能因不同产品型号和软件版本而略有差异,请以实际情况为准。 3.4 配置步骤# 生成RSA密钥对。 system-view [Device] public-key local create rsa The range of public key size is (512 ~ 2048). If the key modulus is greater than 512, it will take a few minutes. Press CTRL+C to abort. Input the modulus length [default = 1024]: Generating Keys... ........................++++++ ...................++++++ ..++++++++ ............++++++++ Create the key pair successfully. # 生成DSA密钥对。 [Device] public-key local create dsa The range of public key size is (512 ~ 2048). If the key modulus is greater than 512, it will take a few minutes. Press CTRL+C to abort. Input the modulus length [default = 1024]: Generating Keys... .++++++++++++++++++++++++++++++++++++++++++++++++++* ........+......+.....+......................................+ ...+.................+..........+...+. Create the key pair successfully. # 使能SSH服务器功能。 [Device] ssh server enable # 配置接口GigabitEthernet1/0/1的IP地址,客户端将通过该地址连接Stelnet服务器。 [Device] interface GigabitEthernet 1/0/1 [Device-GigabitEthernet1/0/1] ip address 192.168.1.40 255.255.255.0 [Device-GigabitEthernet1/0/1] quit # 设置Stelnet客户端登录用户界面的认证方式为scheme。 [Device] line vty 0 63 [Device-line-vty0-63] authentication-mode scheme [Device-line-vty0-63] quit # 创建本地用户client001,并设置用户密码、服务类型和用户角色。 [Device] local-user client001 class manage New local user added. [Device-luser-manage-client001] password simple 123456TESTplat&! [Device-luser-manage-client001] service-type ssh [Device-luser-manage-client001] authorization-attribute user-role network-admin [Device-luser-manage-client001] quit 3.5 验证配置Stelnet客户端软件有很多,例如PuTTY、OpenSSH等。本文中仅以客户端软件PuTTY0.60为例,说明Stelnet客户端的配置方法。
# 安装PuTTY0.60软件。 # 打开PuTTY.exe程序,点击“Session”功能区,出现如图3-2所示的客户端配置界面。 · 在“Host Name(or IP address)”文本框中输入Stelnet服务器的IP地址为192.168.1.40。 · 在“Port”文本框中输入SSH协议端口号22。 · 在“Connection type”区域选择SSH协议。 图3-2 Stelnet客户端配置界面
# 在图3-2界面中,单击按钮。弹出“PuTTY Security Alert”对话框。 图3-3 Stelnet客户端登录界面(一)
# 单击“是(Y)”按钮,并输入用户名“client001”和密码“123456TESTplat&!”,即可成功登录设备使用所有命令。 login as: client001 [email protected]'s password:
****************************************************************************** * Copyright (c) 2004-2023 Hangzhou H3C Tech. Co., Ltd. All rights reserved. * * Without the owner's prior written consent, * * no decompiling or reverse-engineering shall be allowed. * ****************************************************************************** 3.6 配置文件 # interface GigabitEthernet1/0/1 port link-mode route ip address 192.168.1.40 255.255.255.0 # line vty 0 63 authentication-mode scheme # ssh server enable # local-user client001 class manage password hash $h$6$CqMnWdX6LIW/hz2Z$4+0Pumk+A98VlGVgqN3n/mEi7hJka9fEZpRZIpSNi9bcBEXhpvIqaYTvIVBf7ZUNGnovFsqW7nYxjoToRDvYBg== service-type ssh authorization-attribute user-role network-admin authorization-attribute user-role network-operator # 4 相关资料· 《H3C MSR 系列路由器 配置指导(V7)》中的“安全配置指导” · 《H3C MSR 系列路由器 命令参考(V7)》中的“安全命令参考” |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |