分享

华为CE交换机使用ACL控制STelnet客户端登录权限

 昵称11935121 2018-07-21

适用产品和版本

CE12800/CE6800/CE5800系列产品V100R001C00或更高版本。

CE12800E系列产品V200R002C50或更高版本。

组网需求

在企业网络中为满足新业务需求经常需要远程登录到设备上进行配置。为了防止非法客户端登录设备,需要对客户端的登录权限进行限制,同时为了确保数据传输的安全性使用STelnet登录方式。

如图2-52所示,PC1和PC2与设备相连。保证只有PC1才能登录设备。

图2-52 使用ACL控制STelnet用户登录权限组网图

华为CE交换机使用ACL控制STelnet客户端登录权限

配置思路

可采用如下的配置思路进行配置:

  1. PC1、PC2安装登录SSH服务器的PuTTY软件。
  2. 在SSH服务器端生成本地密钥对,实现SSH服务器端和客户端进行安全地数据交互。
  3. 在SSH服务器端配置SSH用户,并使能STelnet服务功能,确保设备只能使用STelnet方式进行远程登录。
  4. 配置安全策略,保证只有PC1才能使用STelnet登录设备。

说明:

本举例仅以PuTTY软件为例,用户也可以选择其他功能相同的软件。

操作步骤

  1. PC1、PC2安装登录SSH服务器的PuTTY软件。(略)
  2. 在SSH服务器端生成本地密钥对

system-view

[~HUAWEI] sysname SSH Server

[~HUAWEI] commit

[~SSH Server] rsa local-key-pair create

The key name will be: SSH Server_Host

The range of public key size is (512 ~ 2048).

NOTE: Key pair generation will take a short while.

Input the bits in the modulus [default = 2048] : 2048 //建议您使用长度为2048的密钥对以提高设备安全性。从V200R001C00版本开始,仅支持2048bit,不需要用户输入。

[~SSH Server] commit

配置VTY用户界面的相关参数

# 配置VTY用户界面的用户验证方式以及用户级别。

[~SSH Server] user-interface maximum-vty 3

[~SSH Server] user-interface vty 0 2

[~SSH Server-ui-vty0-2] authentication-mode aaa

[~SSH Server-ui-vty0-2] protocol inbound ssh

[~SSH Server-ui-vty0-2] quit

[~SSH Server] commit

创建SSH用户

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

[~SSH Server] aaa

[~SSH Server-aaa] local-user admin1234 password irreversible-cipher Helloworld@6789

[~SSH Server-aaa] local-user admin1234 level 5

[~SSH Server-aaa] local-user admin1234 service-type ssh

[~SSH Server-aaa] quit

[~SSH Server] ssh user admin1234 authentication-type password

[~SSH Server] commit

SSH服务器端开启STelnet服务功能

# 开启STelnet服务功能。

[~SSH Server] stelnet server enable

# 配置SSH用户admin1234的服务方式为STelnet。

[~SSH Server] ssh user admin1234 service-type stelnet

[~SSH Server] commit

配置安全策略,保证只有PC1才能使用STelnet登录设备。

[~SSH Server] acl 2001

[~SSH Server-acl4-basic-2001] rule permit source 10.137.217.10 32

[~SSH Server-acl4-basic-2001] quit

[~SSH Server] ssh server acl 2001

[~SSH Server] commit

验证

通过PC2登录不上SSH服务器,PC1能够登录SSH服务器。PC1登录SSH服务器过程如下:

  1. 通过PuTTY软件登录SSH服务器,输入SSH服务器的IP地址,选择协议类型为SSH。

图2-53 通过PuTTY软件用password认证方式连接SSH服务器示意图

华为CE交换机使用ACL控制STelnet客户端登录权限

2.点击“Open”,出现如下界面,输入用户名和密码,并按Enter键,至此已登录到SSH服务器。

不同版本的显示信息不同:

  • V100R001C00版本

login as: admin1234

Sent username 'admin1234'

admin1234@10.137.217.203's password:

Info: The max number of VTY users is 3, the number of current VTY users online is 1, and total number of terminal users online is 1.

The current login time is 2013-08-04 20:09:11.

First login successfully.

V100R002C00或更高版本

login as: admin1234

Sent username 'admin1234'

admin1234@10.137.217.203's password:

Warning: The initial password poses security risks.

The password needs to be changed. Change now? [Y/N]:n

Info: The max number of VTY users is 3, the number of current VTY users online is 1, and total number of terminal users online is 1.

The current login time is 2013-08-04 20:09:11.

First login successfully.

配置文件

SSH Server的配置文件 (V200R002C50之前版本)

#

sysname SSH Server

#

acl number 2001

rule 5 permit source 10.137.217.10 0

#

aaa

local-user admin1234 password irreversible-cipher $1a$^dQXO5P2I$$KEXM>*IuY;Ir9n(2[^eHG<>$ //此处密文格式仅为示例,不同版本之间可能存在不同。

local-user admin1234 service-type ssh

local-user admin1234 level 5

#

stelnet server enable

ssh server acl 2001

ssh user admin1234

ssh user admin1234 authentication-type password

ssh user admin1234 service-type stelnet

#

user-interface maximum-vty 3

#

user-interface vty 0 2

authentication-mode aaa

protocol inbound ssh

#

return

SSH Server的配置文件 (V200R002C50及之后版本)

#

sysname SSH Server

#

acl number 2001

rule 5 permit source 10.137.217.10 0

#

aaa

local-user admin1234 password irreversible-cipher $1a$^dQXO5P2I$$KEXM>*IuY;Ir9n(2[^eHG<>$ //此处密文格式仅为示例,不同版本之间可能存在不同。

local-user admin1234 service-type ssh

local-user admin1234 level 5

#

stelnet ipv4 server enable

stelnet ipv6 server enable

ssh server acl 2001

ssh user admin1234

ssh user admin1234 authentication-type password

ssh user admin1234 service-type stelnet

#

user-interface maximum-vty 3

#

user-interface vty 0 2

authentication-mode aaa

protocol inbound ssh

#

return

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

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多