H3C S5130系列交换机ssh典型配置举例(passwd认证)

摘自H3C官网:http://www.h3c.com/cn/d_201803/1072475_30005_0.htm

 设备作为Stelnet服务器配置举例(password认证)

1  组网需求

图1所示,网络管理员需要通过Internet远程登录到校园网的网关设备(Device)上对其进行相关配置。为了提高对Device进行管理的安全性,可将Device配置为Stelnet服务器,并在Host上运行Stelnet客户端软件,在二者之间建立SSH连接。要求:

·Device通过SSH的password认证方式对客户端进行认证,认证过程在Device本地完成;

·网络管理员Host的登录用户名为client001,密码为aabbcc,登录设备后可以正常使用所有命令。

图1 设备作为Stelnet服务器配置组网图

2  配置思路

·为了使SSH的版本协商和算法协商过程正常运行,且为了保证客户端对连接的服务器的认证正常进行,请在服务器端生成RSA和DSA密钥对。

·为了采用本地认证的方式认证用户,需要在本地服务器Device上创建相应的本地用户,并在本地用户视图下配置密码。

·Stelnet客户端通过VTY用户线访问设备。因此,需要配置登录用户线的认证方式为scheme方式。

·为了使Stelnet用户登录设备后能正常使用所有命令,将用户角色设置为network-admin,缺省情况下本地用户的用户角色为network-operator。

3  使用版本

本举例是在S5130EI_E-CMW710-R3106版本上进行配置和验证的。

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

# 创建VLAN 2,并将GigabitEthernet1/0/2加入VLAN 2。

[Device] vlan 2

[Device-vlan2] port gigabitethernet 1/0/2

[Device-vlan2] quit

# 配置VLAN接口2的IP地址,客户端将通过该地址连接Stelnet服务器。

[Device] interface vlan-interface 2

[Device-Vlan-interface2] ip address 192.168.1.40 255.255.255.0

[Device-Vlan-interface2] 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 aabbcc

[Device-luser-manage-client001] service-type ssh

[Device-luser-manage-client001]authorization-attribute user-role network-admin

[Device-luser-manage-client001] quit

5 配置文件

#

vlan 2

#

interface Vlan-interface2

 ip address 192.168.1.40 255.255.255.0

#

interface GigabitEthernet1/0/2

 port access vlan 2

#

line vty 0 63

 authentication-mode scheme

#

ssh server enable

#

local-user client001 class manage

 password hash

$h$6$CqMnWdX6LIW/hz2Z$4+0Pumk+A98VlGVgqN3n/mEi7hJka9fEZpRZIpSNi9b

cBEXhpvIqaYTvIVBf7ZUNGnovFsqW7nYxjoToRDvYBg==

 service-type ssh

 authorization-attribute user-role network-admin

 authorization-attribute user-role network-operator

#

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 通过consule进行配置: # 设置系统的日期、时间和时区 <HUAWEI>clock timezone BJ ...
    lxx_call阅读 1,410评论 0 3
  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,461评论 0 10
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 135,027评论 19 139
  • 男人的好,只有在他身边的那个女人才知道 跟我家相公在一起之前,只知道他是个脾气挺好的人,并且还小有才华(这也是当初...
    浮生晓事阅读 2,308评论 0 1
  • “您的文章XX未能入选专题XX,继续加油~”这是我经常一大早就会看到的简书提醒。每次我的表情都是惊人的相似,眉毛和...
    上米阅读 877评论 21 27