qmya00 发表于 2018-7-20 08:03:24

cisco+H3C交换机SSH配置实例

  Cisco交换机+H3C交换机SSH配置(cisco关闭Telnet)
  Cisco交换机

[*]  进入交换机配置模式:
[*]  a)      CoreSW#configure terminal
[*]  配置交换机名称:
[*]  a)      CoreSW(config)#hostname CoreSW(可选配置)。
[*]  配置domain-name:
[*]  a)      CoreSW(config)#ip domain-namexxxxx.com(名称按自己要求而定)。
[*]  配置登录用户和密码(如有本地用户可不创建)。
[*]  a)      CoreSW(config)#username testpassword 0 test(密码类型自选)。
[*]  配置可连接的虚拟终端数:
[*]  a)      CoreSW(config)#line vty 0 4
[*]  b)      CoreSW(config-line)#login local
[*]  SSH服务配置:
[*]  a)      CoreSW(config)#crypto keygenerate rsa
  The name for the keys will be: CoreSW.xxxxxx.com

  Choose the>  General Purpose Keys. Choosing a keymodulus greater than 512 may take
  a few minutes.
  How many bits in the modulus :CoreSW.xxxxx.com
  % A decimal number between 360 and4096.
  How many bits in the modulus : (这里我选的是默认,也就是直接回车,也可以自己定义。)
  % Generating 512 bit RSA keys, keyswill be non-exportable...
   (elapsed time was 2 seconds)。

[*]  保存配置。
[*]  a)      CoreSW#copy running-configstartup-config
[*]  配置SSH超时时间。
[*]  a)      CoreSW(config)#ip ssh time-out120
[*]  配置重复登录次数。
[*]  a)      CoreSW(config)#ip sshauthentication-retries 5
[*]  配置SSH版本
[*]  a)      CoreSW(config)#ip ssh version 2
  10.测试SSH方式连接交换机。
  ===============================到此处配置已完成================================
  H3C交换机

[*]  生成RSA和DSA秘钥对
[*]  a)      public-key localcreate rsa(输入Y即可)
[*]  b)      public-key localcreate dsa(直接回车即可)
[*]  设置用户登录认证和接口协议
[*]  a)      user-interfacevty 0 4
[*]  b)      authentication-modescheme
[*]  c)      protocolinbound ssh
[*]  用户设置
[*]  a)      如有相关用户可不创建新的用户。
[*]  b)      创建新用户命令如下:
[*]  c)      local-user user-name
[*]  d)      authorization-attributelevel 3(用户级别)
[*]  e)      service-typessh (服务类型)
[*]  指定用户认证方式为password
[*]  a)      ssh userwangchuyuan service-type all authentication-type password
  ===============================到此处配置已完成================================
页: [1]
查看完整版本: cisco+H3C交换机SSH配置实例