set console密码            

* **************************** 

user-interface console 0 


authentication-mode password 

set authentication password cipher ***  


*********************************** 

删除默认用户                      

* ***********************************

user-interface vty 0 4 


undo set authentication password 

undo user privilege level 


创建SSH用户      *

****************** 

rsa local-key-pair create 

user-interface vty 0 4 

user privilege level 3 

authentication-mode 

aaa  protocol inbound ssh 

ssh user admin  

ssh user admin authentication-type password 

stelnet server enable  

ssh user admin service-type stelnet aaa  

local-user admin password cipher *** 

local-user admin service-type ssh


添加SSH用户               * 

***************************  

ssh user *** authentication-type password 

ssh user *** service-type stelnet 

aaa  local-user *** password cipher ***  

local-user *** service-type ssh   

local-user guest level 1(创建guest用户时需要此命令) 


aaa  undo local-user ***   

**************************** 

SSH ACL设置                *

 **************************** 

acl number 2001  rule 10 permit source IP地址或网络地址 

rule 20 deny   user-interface vty 0 4 

acl 2001 inbound   

acl number 2001  

undo rule 10  

rule 10 permit source 10.3.0.0 0.0.0.255

-------------------------------------------------------------------------

3. 配置步骤(SSH认证方式为口令认证)

[Quidway] rsa local-key-pair create

说明:如果此前已完成生成本地密钥对的配置,可以略过此项操作。

[Quidway] user-interface vty 0 4

[Quidway-ui-vty0-4] authentication-modescheme

[Quidway-ui-vty0-4] protocol inbound ssh

[Quidway] local-user client001

[Quidway-luser-client001] password simplehuawei

[Quidway-luser-client001] service-type ssh

[Quidway] ssh user client001authentication-type password

 

SSH的认证超时时间、重试次数以及服务器密钥更新时间可以采取系统默认值,这些配置完成以后,您就可以在其它与以太网交换机连接的终端上,运行支持SSH1.5的客户端软件,以用户名client001,密码huawei,访问以太网交换机了。

[root@main ~]#
在交换机的system-view视图下生成本地密钥,位数为1024
[H3C]
rsalocal-key-pair create
The local-key-pair will be created.
The range of public key size is (512 ~ 2048).
NOTES: If the key modulus is greater than 512,
       It will take a few minutes.
Input the bits in the modulus[default = 1024]:
Generating keys...
......++++++
........................++++++
..Done!
[H3C]
OK,
现在就可以SSH到交换机了.


H3C交换机SSH的基本配置.
local-user root
password simple 66070511
service-type ssh telnet
level 3
ssh user root authentication-type all
ssh user root service-type stelnet
#
user-interface aux 0
user-interface vty 0 4
authentication-mode scheme
user privilege level 3
protocol inbound ssh
#

 

 

H3C工程师配置

说明:

如果此前已完成生成本地密钥的配置,可以略过此步操作。

 

(2)       设置用户登录认证方式。

下面按照两种认证方式分别进行配置。

l              password认证。

# 设置用户接口上的认证模式为AAA认证。

[Quidway] user-interface vty 0 4

[Quidway-ui-vty0-4] authentication-modescheme

# 指定用户client001的登录协议为SSH,认证方式为password

[Quidway-ui-vty0-4] protocol inboundssh   //这里可以不配置,默认是支持所有的,包含ssh,telnet,默认ALL(否则SSH 无法登陆)

[Quidway] local-user client001

[Quidway-luser-client001] password simplehuawei

[Quidway] ssh user client001authentication-type password

 

6500上有些软件版本只能支持的SSH的版本为1.5,使用时请正确选择客户端版本。目前65只支持作为SSH服务器,不能作为SSH客户端;31XX版本中可以支持SSH2.0,可以作为服务器和客户端。

2300系列支持ssh1.x